Displacement sensor, method for detecting the optimal reference position, and method for judging stability of detecting the reference position of displacement sensor

ABSTRACT

A displacement sensor which detects a positional displacement of a movable member, comprises a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member, a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position, when the movable member is in a predetermined position, a reference position detection circuit configured to detect that the movable member is in a reference position based on the signal for detecting the reference position, generated by the generating section of the signal for detecting the reference position, in synchronization with the periodical signal generated by the position signal generating section, and a selecting section configured to be capable of selecting a phase position to be synchronized from a plurality of phase positions on the periodical signal in the synchronization in the reference position detection circuit.

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2002-193448, filed Jul. 2, 2002, the entire contents of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

[0002] 1. Field of the Invention

[0003] The present invention relates to a displacement sensor for use in displacement detection of an encoder, a method for detecting an optimal reference position for the displacement sensor, and a method for judging stability of the detected optimal reference position.

[0004] 2. Description of the Related Art

[0005] As a general example of an encoder according to a conventional art, an optical encoder has been known. That is, this optical encoder includes: a light source section in which a light emitting section such as LED is combined with an optical device for converting a beam light from the light emitting section into a parallel light; an index scale and scale successively irradiated with the parallel light from the light source section; a photodetector disposed on a side opposite to the light source section as seen from the scale; and a signal processing circuit section for processing a signal from the photodetector to output an encoder signal. In this constitution, the index scale, scale, and photodetector are constituted of parts for detecting a position and reference position. That is, slit parts for detecting the position and reference position are disposed in the index scale and scale, additionally the photodetector also includes photo-detection parts for detecting the position and reference position, and position detection/reference position detection is possible by a combination of these.

[0006] Moreover, in objects for detecting the position such as a stage and motor, the combination of the light source section and photodetector is attached to either one of movable and fixed parts. The scale is attached to the other of the movable and fixed parts.

[0007] Moreover, general encoder output signals include: sinusoidal signals which are outputted with the displacement of the movable part of an apparatus and which are different from each other in phase by 90°; A and B phase signals which are pulse (rectangular wave) signals; and Z phase signal (signal for detecting the reference position) outputted when the reference position of the movable part is detected.

[0008] Furthermore, an absolute position of the movable part is unclear when power supply of the apparatus is turned on or position information is cleared, and in this case the reference position can be detected to obtain exact position information.

[0009] Additionally, among the encoders, in a linear encoder for linearly detecting the position, a pattern for detecting the reference position is disposed in the vicinity of one end of a linear scale in many cases. In a rotary encoder for detecting a rotary movement, the pattern for detecting the reference position is usually disposed in one place on a disc-shaped scale.

[0010] Moreover, the movable part is moved to detect the pattern for detecting the reference position of the scale, and a reference position signal is outputted in synchronization with AB phase signals if necessary.

[0011] For example, in Jpn. Pat. Appln. KOKAI Publication No. 8-261795, a mechanism for generating and detecting a signal having a period longer than that of a position detection signal is disposed in the scale, index scale, and light receiving section. That is, in addition to the displacement signal and reference position signal, an auxiliary reference position signal is generated, and is used as an index in synchronizing the reference position signal with the position detection signal.

BRIEF SUMMARY OF THE INVENTION

[0012] According to a first aspect of the present invention, there is provided a displacement sensor which detects a positional displacement of a movable member, comprising:

[0013] a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member;

[0014] a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position, when the movable member is in a predetermined position;

[0015] a reference position detection circuit configured to detect that the movable member is in a reference position, the detection being based on the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position and being in synchronization with the periodical signal generated by the position signal generating section; and

[0016] a selecting section configured to be capable of selecting a phase position to be synchronized from a plurality of phase positions on the periodical signal in the synchronization in the reference position detection circuit.

[0017] According to a second aspect of the present invention, there is provided a displacement sensor which detects a positional displacement of a movable member, comprising:

[0018] a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member;

[0019] a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position, when the movable member is in a predetermined position;

[0020] a latch section configured to latch the signal for detecting the reference position, generated by the generating section of the signal for detecting the reference position; and

[0021] a reference position detection circuit configured to detect that the movable member is in a reference position based on the signal generated by the latch section in synchronization with the periodical signal generated by the position signal generating section.

[0022] According to a third aspect of the present invention, there is provided a displacement sensor which detects a positional displacement of a movable member, comprising:

[0023] a position signal generating section configured to generate a plurality of periodical signals in accordance with movement of the movable member;

[0024] a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position, when the movable member is in a predetermined position;

[0025] a selecting section configured to be capable of selecting one periodical signal from the periodical signals generated by the position signal generating section; and

[0026] a reference position detection circuit configured to detect that the movable member is in a reference position, the detection being based on the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position and being in synchronization with the periodical signal selected by the selecting section.

[0027] According to a fourth aspect of the present invention, there is provided a displacement sensor which irradiates a movable member with a light from a light source and receives a returned light by a light receiving section to detect a positional displacement of the movable member, comprising:

[0028] a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member;

[0029] a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position, when the movable member is in a predetermined position; and

[0030] a reference position detection circuit configured to detect that the movable member is in a reference position, the detection being based on the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position and being in synchronization with the periodical signal generated by the position signal generating section,

[0031] wherein the light source and light receiving section are formed in the same substrate by a semiconductor process.

[0032] According to a fifth aspect of the present invention, there is provided a displacement sensor which detects a positional displacement of a movable member, comprising:

[0033] a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member;

[0034] a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position of position detection, when the movable member is in a predetermined position;

[0035] a reference position detection circuit configured to detect that the movable member is in a reference position, the detection being based on the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position and being in synchronization with the periodical signal generated by the position signal generating section;

[0036] a selecting section configured to be capable of selecting a phase position to be synchronized from a plurality of phase positions on the periodical signal in the synchronization in the reference position detection circuit; and

[0037] a judging section configured to detect an optimal synchronous position among the phase positions on the periodical signal.

[0038] According to a sixth aspect of the present invention, there is provided a displacement sensor which detects a positional displacement of a movable member, comprising:

[0039] a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member;

[0040] a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position of position detection, when the movable member is in a predetermined position;

[0041] a latch section configured to latch the signal for detecting the reference position, generated by the generating section of the signal for detecting the reference position;

[0042] a reference position detection circuit configured to detect that the movable member is in a reference position based on a signal generated by the latch section in synchronization with the periodical signal generated by the position signal generating section;

[0043] a selecting section configured to be capable of selecting a phase position to be synchronized from a plurality of phase positions on the periodical signal in the synchronization in the reference position detection circuit; and

[0044] a judging section configured to detect an optimal synchronous position among the phase positions on the periodical signal.

[0045] According to a seventh aspect of the present invention, there is provided a displacement sensor which detects a positional displacement of a movable member, comprising:

[0046] a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member;

[0047] a generating section of signals for detecting a reference position, configured to generate a plurality of signals for detecting the reference position, having a mutual phase difference which is not integer times one period of the periodical signal, when the movable member is in a predetermined position;

[0048] a selecting section configured to be capable of selecting one signal for detecting the reference position from the signals for detecting the reference position, generated by the generating section of the signal for detecting the reference position;

[0049] a reference position detection circuit configured to detect that the movable member is in a reference position based on the selected signal for detecting the reference position in synchronization with the periodical signal generated by the position signal generating section; and

[0050] a judging section configured to detect the signal for detecting the reference position, whose synchronization with the position signal is optimal among the signals for detecting the reference position.

[0051] According to an eighth aspect of the present invention, there is provided a displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the displacement sensor comprising:

[0052] a plurality of reference position signal generating position candidates where a reference position signal is generated; and

[0053] a selecting section configured to select one candidate from the reference position signal generating position candidates and switch the reference position signal generating position to the candidate.

[0054] According to a ninth aspect of the present invention, there is provided a method for detecting an optimal reference position candidate of a displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range,

[0055] the displacement sensor

[0056] generating a signal for detecting a reference position, when the movable member is in the predetermined range,

[0057] including a plurality of reference position signal generating position candidates being in a reference position signal generating position where the reference position signal is generated,

[0058] comprising: a selecting section configured to select one generating position candidate as the reference position signal generating position from the generating position candidates; and a judging section configured to detect an optimal generating position candidate from the reference position signal generating position candidates at a time of generation of the signal for detecting the reference position, and

[0059] the selecting section being capable of selecting the reference position signal generating position based on a judgment result of the judging section,

[0060] the method for detecting the optimal reference position candidate of the displacement sensor, comprising:

[0061] detecting the generation of the signal for detecting the reference position;

[0062] detecting the optimal reference position candidate by the judging section;

[0063] outputting the judgment result; and

[0064] switching the setting of the reference position.

[0065] According to a tenth aspect of the present invention, there is provided a method for detecting an optimal reference position candidate of a displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range.

[0066] the displacement sensor

[0067] generating a signal for detecting a reference position, when the movable member is in the predetermined range,

[0068] including a plurality of reference position signal generating position candidates in a reference position signal generating position where the reference position signal is generated,

[0069] comprising: a selecting section configured to select one generating position candidate as the reference position signal generating position from the generating position candidates; and a judging section configured to detect an optimal generating position candidate from the reference position signal generating position candidates at a time of generation of the signal for detecting the reference position, and

[0070] the selecting section being capable of selecting the reference position signal generating position based on a judgment result of the judging section,

[0071] the method for detecting the optimal reference position candidate of the displacement sensor, comprising:

[0072] detecting the generation of the signal for detecting the reference position;

[0073] detecting the optimal reference position candidate by the judging section;

[0074] outputting the judgment result;

[0075] judging whether setting reflects the judgment result; and

[0076] switching the setting of the reference position only when judging that the setting is reflected.

[0077] According to an eleventh aspect of the present invention, there is provided a displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the sensor comprising:

[0078] a generating section of a signal for detecting a reference position configured to generate a signal for detecting the reference position, which is not necessarily synchronized with the periodical signal, when the movable member is in the predetermined range; and

[0079] a stability judging section configured to judge stability of the existing reference position signal generating position based on a phase allowance with the periodical signal at a time of generation of the signal for detecting the reference position and in the reference position signal generating position.

[0080] According to a twelfth aspect of the present invention, there is provided a method for judging stability of reference position detection of a displacement sensor which detects displacement amount based on periodical signals generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a reference position signal generating position as one of the predetermined position and angle,

[0081] the displacement sensor

[0082] generating a signal for detecting a reference position, when the movable member is in a predetermined range, and

[0083] comprising a stability judging section configured to judge stability of the existing reference position signal generating position based on a phase allowance with the periodical signal at a time of generation of the signal for detecting the reference position and reference position signal generating position,

[0084] the method for judging the stability of the reference position detection of the displacement sensor, comprising:

[0085] detecting the generation of the signal for detecting the reference position;

[0086] judging the stability of the existing reference position by the stability judging section; and

[0087] outputting the judgment result.

[0088] According to a thirteenth aspect of the present invention, there is provided a displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the displacement sensor comprising:

[0089] a plurality of reference position signal generating position candidates where the reference position signals are generated;

[0090] judging means for detecting an optimal candidate from the reference position signal generating position candidates; and

[0091] selecting means for selecting one candidate from the reference position signal generating position candidates and switching the reference position signal generating position to the candidate,

[0092] wherein the selecting means is able to select the reference position signal generating position based on a judgment result from the judging means.

[0093] According to a fourteenth aspect of the present invention, there is provided a displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the displacement sensor comprising:

[0094] a plurality of reference position signal generating position candidates where the reference position signals are generated; and

[0095] selecting means for selecting one candidate from the reference position signal generating position candidates and switching the reference position signal generating position to the candidate,

[0096] wherein the reference position signal generating position candidates correspond to a plurality of phases of the periodical signal, and

[0097] the selecting means is able to select and switch to one of a plurality of phase candidates as the phase of the reference position signal generating position.

[0098] According to a fifteenth aspect of the present invention, there is provided a displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the displacement sensor comprising:

[0099] generating means of a signal for detecting a reference position, for generating the signal for detecting the reference position, which is not necessarily synchronized with the periodical signal, when the movable member is in the predetermined range; and

[0100] stability judging means for judging stability of the existing reference position signal generating position based on a phase allowance with the periodical signal at a time of generation of the signal for detecting the reference position and a reference position signal generating position.

[0101] Advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING

[0102] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention, and together with the general description given above and the detailed description of the embodiments given below, serve to explain the principles of the invention.

[0103]FIG. 1 is a diagram showing a constitution of a major part of an optical encoder according to a first embodiment of a displacement sensor of the present invention;

[0104]FIG. 2 is a block diagram showing the constitution of a signal processing circuit section in the encoder according to the first embodiment of the present invention;

[0105]FIG. 3 is a time chart showing that an input from a photodetector is processed by the signal processing circuit of FIG. 2;

[0106]FIG. 4 is a block diagram showing each detailed constitution of a switch in FIG. 2 and a synchronous circuit switched by the switch in order to select a reference position signal (g) in the encoder according to a second embodiment of the present invention;

[0107]FIG. 5 is a block diagram showing each detailed constitution of the switch in FIG. 2 and the synchronous circuit switched by the switch in order to select a reference position signal (h) in the encoder according to the second embodiment of the present invention;

[0108]FIG. 6 is a time chart showing a state of a change of each signal when displacement is caused in a direction reverse to that of FIG. 3;

[0109]FIG. 7 is a block diagram showing the constitution of the signal processing circuit section of the encoder according to a third embodiment of the present invention;

[0110]FIG. 8 is a time chart showing that the input from the photodetector is processed in the signal processing circuit section of the encoder according to the third embodiment;

[0111]FIG. 9 is a diagram showing the constitution of the major part of the encoder according to a fourth embodiment of the present invention;

[0112]FIG. 10 is a block diagram showing the constitution of the signal processing circuit section of the encoder according to the fourth embodiment;

[0113]FIG. 11 is a time chart showing that the input from the photodetector is processed in the signal processing circuit section of FIG. 10;

[0114]FIG. 12 is a diagram showing the constitution of the major part of the encoder according to a fifth embodiment of the present invention;

[0115]FIG. 13 is a block diagram showing the constitution of the signal processing circuit section (reference position detection circuit section) of the encoder according to the fifth embodiment;

[0116]FIG. 14 is a time chart showing that the input is processed by the signal processing circuit section (reference position detection circuit section) of FIG. 13;

[0117]FIG. 15 is a time chart showing that the input is processed by the signal processing circuit section of the encoder according to a sixth embodiment of the present invention;

[0118]FIG. 16 is a block diagram showing the constitution of the signal processing circuit section of the encoder according to a seventh embodiment of the present invention;

[0119]FIG. 17 is a diagram showing a constitution example of the synchronous circuit in FIG. 16;

[0120]FIG. 18 is a diagram showing the constitution example of a judgment circuit in FIG. 16;

[0121]FIG. 19A is a diagram showing the constitution of the synchronous circuit in the signal processing circuit section of the encoder according to an eighth embodiment of the present invention;

[0122]FIG. 19B is a diagram showing a concrete constitution of the circuit of FIG. 19A;

[0123]FIG. 20 is a diagram showing another constitution of the synchronous circuit in the signal processing circuit section of the encoder according to the eighth embodiment of the present invention;

[0124]FIG. 21 is a diagram showing the constitution of the judgment circuit in the signal processing circuit section of the encoder according to the eighth embodiment;

[0125]FIG. 22 is a block diagram showing the constitution of the signal processing circuit section of the encoder according to a ninth embodiment of the present invention;

[0126]FIG. 23 is a block diagram showing the constitution of the signal processing circuit section of the encoder according to a tenth embodiment of the present invention;

[0127]FIGS. 24A and 24B are diagrams showing two-dimensional graphs of a combination of signal levels of position signals (a), (b) to describe relations between position signals (a), (b) and signals for detecting a reference position (f1), (f2), (f3);

[0128]FIG. 25 is a block diagram showing the constitution of the signal processing circuit section of the encoder according to an eleventh embodiment of the present invention;

[0129]FIG. 26 is a diagram showing the constitution of the judgment circuit in the signal processing circuit section of the encoder according to the eleventh embodiment;

[0130]FIG. 27 is a diagram showing another constitution of the judgment circuit in the signal processing circuit section of the encoder according to the eleventh embodiment;

[0131]FIGS. 28A and 28B are explanatory views of area dividing for judging the optimal synchronous position;

[0132]FIG. 29 is a block diagram showing the constitution of the signal processing circuit section of the encoder according to a twelfth embodiment of the present invention;

[0133]FIG. 30 is a diagram showing reference position signal generating position candidates and division of Lissajous figure of the analog position signals (a) and (b);

[0134]FIG. 31 is a diagram showing the reference position signal generating position candidates and another division of Lissajous figure of the analog position signals (a) and (b);

[0135]FIG. 32 is a diagram showing the reference position signal generating position candidates and still another division of Lissajous figure of the analog position signals (a) and (b);

[0136]FIG. 33 is a diagram showing the constitution of the synchronous circuit in the signal processing circuit section of the encoder according to the twelfth embodiment;

[0137]FIG. 34 is a diagram showing a concrete constitution of the circuit of FIG. 33;

[0138]FIG. 35 is a diagram showing another concrete constitution of the circuit of FIG. 33;

[0139]FIG. 36 is a diagram showing still another concrete constitution of the circuit of FIG. 33;

[0140]FIG. 37 is a diagram showing another concrete constitution of the circuit of FIG. 33;

[0141]FIG. 38 is a diagram showing still another concrete constitution of the circuit of FIG. 33;

[0142]FIG. 39 is a diagram showing the concrete constitution of the judgment circuit in the signal processing circuit section of the encoder according to the twelfth embodiment;

[0143]FIG. 40 is a diagram showing another concrete constitution of the judgment circuit in the signal processing circuit section of the encoder according to the twelfth embodiment;

[0144]FIG. 41 is a diagram showing still another concrete constitution of the judgment circuit in the signal processing circuit section of the encoder according to the twelfth embodiment;

[0145]FIG. 42 is a time chart showing that the input from the photodetector at a time of displacement in a counterclockwise direction on Lissajous circle is processed by the signal processing circuit of FIG. 29;

[0146]FIG. 43 is a time chart showing that the input from the photodetector is processed by the signal processing circuit of FIG. 29 when displacement occurs in a clockwise direction on Lissajous circle;

[0147]FIG. 44 is a diagram showing a detection flow of the optimal synchronous position;

[0148]FIG. 45 is a diagram showing another example of the detection flow of the optimal synchronous position;

[0149]FIG. 46 is a diagram showing a stability judgment flow of the existing synchronous position;

[0150]FIG. 47 is a diagram showing another example of the stability judgment flow of the existing synchronous position;

[0151]FIG. 48 is a block diagram showing the constitution of the signal processing circuit section of the encoder according to a thirteenth embodiment of the present invention;

[0152]FIG. 49 is a diagram showing the reference position signal generating position candidates and the division of Lissajous figure of the analog position signals (a) and (b);

[0153]FIG. 50 is a diagram showing the constitution of a binarizing circuit of the position signal in the signal processing circuit section of the encoder according to the thirteenth embodiment;

[0154]FIG. 51A is a diagram showing the constitution of the synchronous circuit in the signal processing circuit section of the encoder according to the thirteenth embodiment;

[0155]FIG. 51B is a diagram showing the concrete constitution of the circuit of FIG. 51A; and

[0156]FIG. 52 is a diagram showing the constitution of the judgment circuit in the signal processing circuit section of the encoder according to the thirteenth embodiment.

DETAILED DESCRIPTION OF THE INVENTION

[0157] Embodiments of the present invention will be described hereinafter with reference to the drawings. It is to be noted that in the following embodiments, as a displacement sensor, a linear encoder for performing linear position detection will be described in an example, but the present invention is not limited to the linear encoder, and can needless to say be applied to displacement sensors for detecting various mechanical displacements such as a rotary encoder for detecting a rotary movement.

FIRST EMBODIMENT

[0158] [Constitution]

[0159] A constitution of a major part of the encoder according to a first embodiment of a displacement sensor of the present invention, except a signal processing circuit section, is not especially limited as long as a position signal (position detection signal) and a signal for detecting a reference position are obtained.

[0160] For example, general constitutions such as a constitution by an optical encoder shown in FIG. 1 can be applied. In the example of FIG. 1, the optical encoder has been described, but other types of encoders such as a magnetic encoder may also be used.

[0161] That is, as shown in FIG. 1, the optical encoder is constituted of: a light source section 10 in which a light emitting section 1 such as LED is combined with an optical device 2 for converting a beam light from the light emitting section 1 into a parallel light; an index scale 3 and scale 4 successively irradiated with the parallel light from the light source section 10; a photodetector 5 disposed on a side opposite to the light source section 10 as seen from the scale 4; and a signal processing circuit section 6 which processes a signal from the photodetector 5 to output an encoder signal.

[0162] In this constitution, for the index scale 3, scale 4, and photodetector 5, a combination of slits 3 a formed in the index scale 3, slits 4 a formed in the scale 4, and photo-detection sections 5 a formed in the photodetector 5 is used for detecting positions. A combination of a slit 3 b formed in the index scale 3, a slit 4 b formed in the scale 4, and a photo-detection section 5 b formed in the photodetector 5 is used for detecting a reference position.

[0163] In an object for detecting the position of a stage or motor, the combination of the light source section 10, index scale 3, and photodetector 5 is attached to either one of movable and fixed parts. The scale 4 is attached to the other of the movable and fixed parts.

[0164] Here, signals (A(+), A(−), B(+), B(−)) different from one another in phase by 90° are outputted from light receiving devices of the photo-detection sections 5 a in accordance with the movement of the scale 4. For convenience of description in FIG. 3 described later, the signal A(+) is shown as a position signal (a), the signal B(+) is shown as a position signal (b), a signal [A(+)-A(−)] is shown as the position signal (a), a signal [B(+)-B(−)] is shown as the position signal (b), and the other signals are not shown. It is to be noted that a signal for detecting the reference position (e) is outputted from the light receiving device of the photo-detection section 5 b as a Z phase signal outputted in detecting a reference position of the movable part. This signal for detecting the reference position (e) is an original signal for detecting the reference position, and is not necessarily synchronized with the position signals (a) and (b) which are periodical signals.

[0165]FIG. 2 is a block diagram showing the constitution of the signal processing circuit section 6 in the encoder of FIG. 1 according to the first embodiment of the present invention. The signal processing circuit section 6 includes: a binarizing circuit 101 for converting analog position signals (a) and (b) to digital position signals (c) and (d); a binarizing circuit 102 for binarizing the signal for detecting the reference position (e) at a predetermined slice level to convert the signal to a digital signal for detecting the reference position (f); a synchronous circuit 103 for synchronizing the digital signal for detecting the reference position (f) from the binarizing circuit 102 with the digital position signals (c) and (d) from the binarizing circuit 101 to generate a reference position signal (g) or (h); and a switch 104 for switching a timing of synchronization in the synchronous circuit 103. It is to be noted that in FIG. 2, the reference position signal (g) or (h) is obtained in synchronization with the digital position signals (c) and (d), but the reference position signal (g) or (h) can also be obtained in synchronization with the analog position signal (a) or (b) by a similar function.

[0166] [Operation]

[0167]FIG. 3 is a time chart showing that an input from the photodetector 5 shown in FIG. 1 is processed by the signal processing circuit section 6 of FIG. 2. In FIG. 3, the horizontal axis indicates time, and shows a change of each signal when displacement at a constant speed is caused.

[0168] That is, in the binarizing circuit 101, the analog position signals (a) and (b) of the encoder which periodically change with the displacement (relative movement of the scale 4) are binarized to obtain the digital position signals (c) and (d). In the binarizing circuit 102, the signal for detecting the reference position (e) is binarized at a predetermined slice level to obtain the digital signal for detecting the reference position (f).

[0169] Moreover, one is selected from the following two methods to obtain the reference position signal. That is, in the first method, in the synchronous circuit 103, the digital signal for detecting the reference position (f) is synchronized with a rise of the position signal (a) or (c) to obtain a high level, and synchronized with a level change of the position signal (b) or (d) to obtain a low level, so that the reference position signal (g) is obtained. In the second method, in the synchronous circuit 103, the digital signal for detecting the reference position (f) is synchronized with a fall of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (h) is obtained. One is selected from these two methods to output the reference position signal (g) or (h). This selection is carried out by the switch 104.

[0170] Here, the position signals (a) and (c) have a phase difference of 90° from the position signals (b) and (d). It is to be noted that the position signal (a) and (b) and the signal for detecting the reference position (e) which are analog signals may be signals of any type as long as the position signals (c) and (d) and the signal for detecting the reference position (f) which are digital signals can be created. Furthermore, the inputs from the photodetector 5 shown in FIG. 1 may be only the digital signals, and may not include any analog signal. When the inputted analog position signal is digitized, a resolution may be enhanced by phase interpolation.

[0171] Moreover, the position detection is carried out by inputting the digital position signals (c) and (d) into a counter (not shown). In this case, when the reference position signal (g) or (h) is generated, the counter is reset, and it is accordingly possible to obtain the reference position of the position detection.

[0172] As described above, the signal for detecting the reference position (e) is digitized to make the digital signal for detecting the reference position (f), and the digital signal for detecting the reference position (f) is synchronized with the position signals (c) and (d) which are periodical signals to generate the reference position signal (g) or (h). At this time, even when there are a plurality of timings satisfying one period condition in one reference position detection, the reference position signal (g) or (h) is constituted to be generated only at an earliest condition satisfying timing. This also applies to the respective embodiments described later.

[0173] [Effect]

[0174] According to the first embodiment, it is possible to select the synchronous position with the position signal in accordance with a way of output of the signal for detecting the reference position.

[0175] Therefore, it is possible to select the synchronous position which reduces a deviation of a reference position possibly caused by unstable factors such as a signal noise or wobble, and further stability of a light source, temperature characteristics of a light emitting/receiving device and fluctuations, and deviations from designs of individual encoders in the optical encoder. For example, it is considered that by the above-described unstable factors, an output level of the signal for detecting the reference position (e) of FIG. 3 is raised, or shifted in a left direction in the figure, or a slice level slightly drops. At this time, assuming that the signal for detecting the reference position (e) changes to a fine line from a bold line, the digital signal for detecting the reference position (f) changes as shown by a broken line. Accordingly, a position deviating by one period as shown by the broken line in the reference position signal (h) is detected as the reference position signal. On the other hand, this change does not easily occur in the reference position signal (g). Therefore, in this case, the reference position signal (g) is selected, deterioration of reference position detection precision is accordingly inhibited, and it is possible to stably detect the reference position.

[0176] Moreover, in the present embodiment, except the signal processing circuit section 6, a member for generating an auxiliary signal for detecting the reference position is not disposed. Therefore, the reference position can stably be detected, and it is possible to supply a small-sized and inexpensive encoder.

SECOND EMBODIMENT

[0177] [Constitution]

[0178] The constitution of the major part of a second embodiment is not especially limited as long as the position signal and the signal for detecting the reference position are obtained except the signal processing circuit section 6 in the same manner as in the first embodiment. For example, a general constitution may be used such as an optical encoder constitution shown as the constitution of the major part of the above-described first embodiment in FIG. 1. In the example of FIG. 1, the optical encoder has been described, but the other types such as the magnetic encoder may also be used. The constitution of the signal processing circuit section 6 in the encoder of FIG. 1 according to the second embodiment of the present invention may be similar to that of the block diagram shown in FIG. 2. It is to be noted that in FIG. 2, the reference position signal (g) or (h) is obtained in synchronization with the digital position signals (c) and (d), but the reference position signal (g) or (h) can also be obtained in synchronization with the analog position signals (a) and (b).

[0179]FIGS. 4 and 5 are block diagrams showing each detailed constitution of the switch 104 in FIG. 2 and the synchronous circuit 103 switched by the switch 104 in order to select the reference position signal (g) or (h). These circuits can easily and inexpensively be manufactured by a generally obtainable logic ICs.

[0180] That is, in the constitution shown in FIG. 4, as components constituting the synchronous circuit 103, there are disposed a rise detection circuit 103 a of the position signal (c), a low level detection circuit 103 b of the position signal (d), and an AND circuit 103 c which obtains a logical product of outputs from the rise detection circuit 103 a and low level detection circuit 103 b. As the components constituting the switch 104, there is disposed an AND circuit 104 a which obtains the logical product of the output from the AND circuit 103 c and the digital signal for detecting the reference position (f). Moreover, the reference position signal (g) is outputted from the AND circuit 104 a.

[0181] On the other hand, in the constitution shown in FIG. 5, as the components constituting the synchronous circuit 103, there are disposed a fall detection circuit 103 d of the position signal (c), a high level detection circuit 103 e of the position signal (d), and an AND circuit 103 f which obtains the logical product of the outputs from the fall detection circuit 103 d and high level detection circuit 103 e. As the components constituting the switch 104, there is disposed an AND circuit 104 b which obtains the logical product of the output from the AND circuit 103 f and the digital signal for detecting the reference position (f). Moreover, the reference position signal (h) is outputted from the AND circuit 104 b.

[0182] [Operation]

[0183] Even in this second embodiment, the state of the processing of the input from the photodetector 5 by the signal processing circuit section 6 is similar to that of the time chart according to the first embodiment shown in FIG. 3.

[0184] Moreover, FIG. 6 is a time chart showing the state of a change of each signal when displacement is caused in a direction reverse to that of FIG. 3. At this time, progresses of phases of the analog position signals (a) and (b) and the digital position signals (c) and (d) are reversed with respect to those in FIG. 3. When the displacement is caused in an opposite direction, the synchronous circuit 103 carries out the process shown in FIG. 6 in the circuit constitution shown in FIGS. 4 and 5, and accordingly the reference position signal is not brought in a detected state. Therefore, the reference position is not detected in the displacement of the opposite direction.

[0185] It is to be noted that when the synchronous circuit 103 shown in FIGS. 4 and 5 is appropriately designed, the reference position can also be detected only with the displacement of the opposite direction.

[0186] [Effect]

[0187] Even in this second embodiment, an effect similar to that of the above-described first embodiment is obtained.

[0188] Moreover, as a peculiar effect by the present embodiment, it is possible to detect the reference position, only when the displacement is caused in a given direction. This produces advantages that the detection is not easily influenced by backlashes of the movable part and the reference position does not have to be doubly detected at the reference position detection time. The reference position detection high in precision and convenient in use is possible.

THIRD EMBODIMENT

[0189] [Constitution]

[0190] The constitution of the major part of a third embodiment is not especially limited as long as the position signal and the signal for detecting the reference position are not obtained except the signal processing circuit section 6 in the same manner as in the first and second embodiments. For example, the general constitution may be used such as the optical encoder constitution shown as the constitution of the major part of the above-described first embodiment in FIG. 1. In the example of FIG. 1, the optical encoder has been described, but the other types such as the magnetic encoder may also be used.

[0191]FIG. 7 is a block diagram showing the constitution of the signal processing circuit section 6 of the encoder according to the third embodiment of the displacement sensor of the present invention. The signal processing circuit section 6 according to the third embodiment includes: a phase interpolation circuit 105 for phase-dividing the analog position signals (a) and (b) to convert the signals into the digital position signals (c) and (d); the binarizing circuit 102 for binarizing the signal for detecting the reference position (e) at the predetermined slice level to convert the signal into the digital signal for detecting the reference position (f); a latch circuit 106 for holding rise of the digital signal for detecting the reference position (f) to form a latch signal (i); the synchronous circuit 103 for synchronizing the latch signal (i) from the latch circuit 106 with the position signals (a) and (d) to generate the reference position signal (g) or (h); and the switch 104 for switching a timing of synchronization in the synchronous circuit 103. In the signal processing circuit section 6 of the constitution shown in FIG. 7, as described later, the rise of the position signal (a) is detected at a point passing a center of amplitude. The reference position signal (g) or (h) is obtained in synchronization with the position signals (a) and (d), but an appropriate signal may be selected from the position signals (a), (b), (c), and (d) and synchronized.

[0192] [Operation]

[0193]FIG. 8 is a time chart showing that the input from the photodetector 5 shown in FIG. 1 is processed by the signal processing circuit section 6 of FIG. 7. In FIG. 8, the horizontal axis indicates time, and shows the change of each signal when the displacement at the constant speed is caused.

[0194] That is, in the phase interpolation circuit 105, the analog position signals (a) and (b) which periodically change with the displacement (relative movement of the scale 4) are phase-divided and binarized, so that the digital position signals (c) and (d) are obtained. In the binarizing circuit 102, the signal for detecting the reference position (e) is binarized at the predetermined slice level to obtain the digital signal for detecting the reference position (f). Moreover, in the latch circuit 106, the rise of the digital signal for detecting the reference position (f) from the binarizing circuit 102 is detected to set the latch signal (i) to a high level.

[0195] Moreover, the reference position signal is obtained in a region where the latch signal (i) has the high level. In this case, rather than to obtain the signal in the region where the latch signal (i) has the high level, to be more precise, the high level is held until the reference position signal is detected. That is, the latch circuit 106 functions so as to hold the level of the latch signal (i) until the timing of synchronization in order to synchronize the reference position detection with the position signals (a) and (d). Accordingly, even when the original digital signal for detecting the reference position (f) is brought in a non-detection state, the reference position can securely be detected in synchronization with the position signal. The latch signal (i) in the latch circuit 106 needs to be cleared from when the reference position is detected until the next reference position is detected.

[0196] Moreover, one is selected from the following two methods to obtain the reference position signal. In the first method, in the synchronous circuit 103, the latch signal (i) is synchronized with the rise of the position signal (a) to obtain the high level, and synchronized with the level change of the position signal (d) to obtain the low level, so that the reference position signal (g) is obtained. In the second method, in the synchronous circuit 103, the latch signal (i) is synchronized with the fall of the position signal (a) to obtain the high level, and synchronized with the level change of the position signal (d) to obtain the low level, so that the reference position signal (h) is obtained. One is selected from these two methods to output the reference position signal (g) or (h). This selection is carried out by the switch 104.

[0197] Here, the position signals (a) and (c) have a phase difference of 90° from the position signals (b) and (d). The position signals (a) and (b) and the signal for detecting the reference position (e) which are analog signals may be the signals of any type as long as the position signals (c) and (d) and the signal for detecting the reference position (f) which are digital signals can be created. Furthermore, the inputs may be only the digital signals, and may not include any analog signal.

[0198] Moreover, the position detection is carried out by inputting the digital position signals (c) and (d) into the counter (not shown). In this case, when the reference position signal (g) or (h) is generated, the counter is reset, and it is accordingly possible to obtain the reference position of the position detection.

[0199] [Effect]

[0200] According to the present embodiment, it is possible to select the synchronous position with the position signal in accordance with the way of output of the signal for detecting the reference position. Therefore, it is possible to select the synchronous position which reduces the deviation of the reference position possibly caused by unstable factors such as the signal noise or wobble, further stability of the light source, temperature characteristics of the light emitting/receiving device and fluctuations, and deviations from designs of individual encoders in the optical encoder.

[0201] Furthermore, as the effect peculiar to the present embodiment, the signal for detecting the reference position (e) is held by the latch circuit 106. Therefore, when a detection width of the digital signal for detecting the reference position (f) is reduced, and even after the detection state is eliminated, it is possible to synchronize the signal with the position signal. Therefore, even with respect to the change of the output level of the signal for detecting the reference position (e) shown in FIG. 8 or the change of the shift or slice level in a left/right direction in the figure by the above-described unstable factors, tolerance is enhanced.

[0202] Moreover, when the rise position of the latch signal (i) can be designed/disposed in a position ahead of the synchronous position of the phase A by about 180°, an allowance of ±180° is produced. That is, there is a positional deviation tolerance of +½ times a pitch of the position signal. Even when it is difficult to set the phase difference between the rise position of the latch signal (i) and the synchronous position of the phase A, an allowance of ±90° or more is generated by selecting the synchronous position. Therefore, when the reference position signal (g) or (h) is selected, the deterioration of the reference position detection precision is inhibited, and the stable reference position detection is possible.

[0203] Furthermore, in this embodiment, except the signal processing circuit section 6, the member for generating the auxiliary signal for detecting the reference position is not disposed. Therefore, the reference position can stably be detected, and it is possible to supply the small-sized and inexpensive encoder.

[0204] Additionally, by using a synchronous method having a limiting function with the position signal in a detection direction as described in the second embodiment, it is possible to detect the reference position, only when the displacement is caused in a reference position given direction. This produces the advantages that the detection is not easily influenced by the backlashes of the movable part and the reference position does not have to be doubly detected at the reference position detection time. The reference position detection high in precision and convenient in use is possible.

FOURTH EMBODIMENT

[0205] [Constitution]

[0206]FIG. 9 is a diagram showing the constitution of the major part of the encoder according to a fourth embodiment of the displacement sensor of the present invention. Additionally, needless to say, except the signal processing circuit section, the constitution is not especially limited to this constitution as long as the position signal and the signal for detecting the reference position are obtained.

[0207] As shown in FIG. 9, the optical encoder according to the fourth embodiment is constituted of: the light source section 10 in which the light emitting section 1 such as LED is combined with the optical device 2 for converting the beam light from the light emitting section 1 into the parallel light; the index scale 3 and scale 4 successively irradiated with the parallel light from the light source section 10; the photodetector 5 disposed on the side opposite to the light source section 10 as seen from the scale 4; and the signal processing circuit section 6 which processes the signal from the photodetector 5 to output the encoder signal.

[0208] In this constitution, for the index scale 3, scale 4, and photodetector 5, the combination of the slits 3 a formed in the index scale 3, the slits 4 a formed in the scale 4, and the photo-detection sections 5 a formed in the photodetector 5 is used for detecting the positions. The combination of the slits 3 b formed in the index scale 3, the slit 4 b formed in the scale 4, and the photo-detection sections 5 b formed in the photodetector 5 is used for detecting the reference position.

[0209] In the object for detecting the position of the stage or motor, the combination of the light source section 10, index scale 3, and photodetector 5 is attached to either one of the movable and fixed parts. The scale 4 is attached to the other of the movable and fixed parts.

[0210] Moreover, in the present embodiment, three each of the slits 3 b and photo-detection sections 5 b for detecting the reference position are disposed in the index scale 3 and photodetector 5. All three respective detection signals in these three photo-detection sections 5 b have similar waveform patterns, and the phase difference satisfies the following equation:

Phase difference α=[one period of position signal]×(i+ ⅓)   (Equation 1)

[0211] where i is an integer.

[0212] It is to be noted that the optical encoder has been described in the present embodiment, but the other types such as the magnetic type may also be used.

[0213]FIG. 10 is a block diagram showing the constitution of the signal processing circuit section 6 in the encoder according to the fourth embodiment of the present invention. That is, the signal processing circuit section 6 includes: the binarizing circuit 101 for converting the analog position signals (a) and (b) to the digital position signals (c) and (d); the binarizing circuit 102 for binarizing signals for detecting the reference position (e1), (e2), and (e3) at the predetermined slice level to convert the signals to digital signals for detecting the reference position (f1), (f2), and (f3); the synchronous circuit 103 for synchronizing one of the digital signals for detecting the reference position (f1), (f2), and (f3) from the binarizing circuit 102 with the digital position signals (c) and (d) from the binarizing circuit 101 to generate the reference position signal (g); and the switch 104 for switching the timing of synchronization in the synchronous circuit 103.

[0214] It is to be noted that in FIG. 10, the reference position signal (g) is obtained in synchronization with the digital position signals (c) and (d), but the reference position signal (g) can also be obtained in synchronization with the analog position signals (a) and (b) by the similar function. Moreover, as described later, in this embodiment, the reference position signal (g) is detected in synchronization with the position signal (a), but this can be realized by the similar function even in synchronization with the position signal (b), (c), or (d).

[0215] It is to be noted that in the present embodiment, the synchronous circuit is disposed in order to exactly synchronize the reference position signal with the position detection signal. However, if there is no problem even in a constitution for exactly determining the phase of the signal for detecting the position in the detection position of the signal for detecting the reference position or even when the reference position signal generating position is not exactly synchronized with the position detection signal, it is possible to omit the synchronous circuit and to set the detection position of the signal for detecting the reference position as the reference position signal generating position.

[0216] [Operation]

[0217]FIG. 11 is a time chart showing that the input from the photodetector 5 shown in FIG. 9 is processed by the signal processing circuit section 6 of FIG. 10. In FIG. 11, the horizontal axis indicates time, and shows the change of each signal when the displacement at the constant speed is caused.

[0218] That is, in the binarizing circuit 101, the analog position signals (a) and (b) of the encoder which periodically change with the displacement (relative movement of the scale 4) are binarized to obtain the digital position signals (c) and (d). In the binarizing circuit 102, the signals for detecting the reference position (e1), (e2), and (e3) are binarized at the predetermined slice level to obtain the digital signals for detecting the reference position (f1), (f2), and (f3). Moreover, in the synchronous circuit 103, one of these digital signals for detecting the reference position (f1), (f2), and (f3) is selected in response to the switch 104. In this case, in the synchronous circuit 103, when the selected digital signal for detecting the reference position is brought in the detection state, the signal is synchronized with the rise of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (g) is obtained. It is to be noted that in FIG. 11, the detection state parts of the reference position signal (g) corresponding to the digital signals for detecting the reference position (f1), (f2), and (f3) correspond to parts of a solid line, fine dotted line, and dotted line in pulse-shaped parts.

[0219] Here, the position signals (a) and (c) have the phase difference of 90° from the position signals (b) and (d). It is to be noted that the position signals (a) and (b) and the signals for detecting the reference position (e1), (e2), and (e3) which are analog signals may be signals of any type as long as the position signals (c) and (d) and the signals for detecting the reference position (f1), (f2), and (f3) which are digital signals can be created. Furthermore, the inputs from a detection system are only the digital signals, and may not include any analog signal. When the position signal is digitized, the resolution may be enhanced by the phase interpolation.

[0220] The position detection is carried out by inputting the digital position signals (c) and (d) into the counter (not shown). Moreover, when the reference position signal (g) is generated, the counter is reset, and it is accordingly possible to obtain the reference position of the position detection.

[0221] [Effect]

[0222] According to the present embodiment, when one is selected from a plurality of signals for detecting the reference position, it is possible to select the synchronous position with the position signal.

[0223] Therefore, it is possible to select the synchronous position which reduces the deviation of the reference position possibly caused by the unstable factors such as the signal noise or wobble, further, in the optical encoder, the stability of the light source, temperature characteristics of the light emitting/receiving device and there fluctuations, and the deviations from designs of individual encoders. For example, it is supposed that by the above-described unstable factors, the output levels of the signals for detecting the reference position (e1), (e2), and (e3) shown in FIG. 11 change, or shift in the left/right direction in the figure, or the slice level slightly increases/decreases. At this time, the reference position signal (g) generated using the signals for detecting the reference position (e1) and (e3) is relatively stable. With the use of the signal for detecting the reference position (e2), since the signal is in the vicinity of the synchronous circuit with the position signal, the signal easily becomes unstable. In this case, a difference for one period or more is sometimes generated in the obtained reference position. However, when only one of the signals is constantly used, there is no practical problem.

[0224] It is to be noted that as the way of synchronization, there is also a method for measuring the displacement in the vicinity of the reference position while synchronizing the signal for detecting the reference position with the position signal. In this case, the signal for detecting the reference position (e2) having a small difference is preferably used. In this case, there is a tolerance of detection position deviation for ±1 period at maximum.

[0225] Therefore, when the reference position signal (g) is selected by the above-described method, the deterioration of the reference position detection precision is inhibited, and the stable reference position detection is possible.

FIFTH EMBODIMENT

[0226] [Constitution]

[0227]FIG. 12 is a diagram showing the constitution of the major part of the encoder according to a fifth embodiment of the displacement sensor of the present invention. In FIG. 12, the encoder is roughly divided into four parts including a base 21, surface light emitting laser 22, photo IC 23, and scale 24. The base 21, surface light emitting laser 22, and photo IC 23 are integrally constituted as a main body, and held while keeping adequate postures with a gap d with respect to the scale 24. On the base 21, there are formed: the surface light emitting laser 22 including a beam emission port 22 a and an emission port 22 b which are disposed obliquely with respect to the scale 24; and the photo IC 23 including a light receiving array section 23 a in which elements having the same structure are arranged at pitches Pp, a light receiving section 23 b, and a signal processing circuit 23 c. The beam emission port 22 a and emission port 22 b are molded integrally with the surface light emitting laser 22 as a light source by a semiconductor process. The wavelength of the light source is set to about 800 nm to 1000 nm, and the light receiving array section is a semiconductor including a silicon base. It is to be noted that when the light sources having different wavelengths are used, the light receiving section desirable for detecting the wavelength can be used to handle the difference. The signal processing circuit 23 c includes a normalizing circuit which carries out gain offset adjustment of the signals of a laser driving circuit, the light receiving array section 23 a, and the light receiving section 23 b.

[0228] Here, one of sums of signals of four array elements of the light receiving array section 23 a is assumed to be a signal A(+), the sum of the signals of neighboring four array elements is a signal B(+), the sum of the signals of further neighboring four array elements is a signal A(−), and the sum of the signals of the remaining four array elements is a signal B(−). Moreover, assuming that a signal [A(+)-A(−)] is a signal (A), and a signal [B(+)-B(−)] is a signal (B), the signal processing circuit 23 c is constituted to output the two signals (A), (B) as encoder signals.

[0229] The scale 24 includes a position detection pattern 24 a in which two patterns having different reflection factors are arranged at a pitch Ps of several tens of micrometers, and a pattern for detecting the reference position 24 b is formed in the end of the position detection pattern.

[0230] Here, the pitch Pp of the elements of the light receiving array section 23 a and the pitch Ps of the position detection pattern 24 a have the following relation:

Pp=2Ps   (Equation 2)

[0231] Moreover, the laser beam emitted from the beam emission port 22 a is incident upon the position detection pattern 24 a of the scale 24 with a spread, and the laser beam diffracted by the position detection pattern 24 a is incident upon the light receiving array section 23 a. The section and pattern are constituted and arranged in this manner. It is to be noted that when the laser beam is parallel light, the light source, scale, and light receiving section may be disposed to satisfy image forming conditions of a diffracted image.

[0232] The surface light emitting laser 22 and photo IC 23 are disposed so that heights in a z direction in FIG. 12 are equal. The gap d is determined so as to form an image twice the position detection pattern 24 a in the light receiving array section 23 a. This gap is determined in a range in which the resolution becomes high by the wavelength and emission angle of the laser beam.

[0233] It is to be noted that in the present embodiment, the diffracted image by reflection in the scale surface is used, but it is possible to use a transmitted light and to dispose the light receiving section above the scale in FIG. 12. In this case, the gap between the light source and scale, and the gap between the scale and light receiving section are selected so that the resolution becomes high by the wavelength and emission angle, and a distance between two gaps may not necessarily be equal. Additionally, when two gap amounts differ, the following relation is established between the scale pitch and the pitch of the light receiving array section:

[0234] Ps:Pp =(gap amount between the light source and scale):(gap amount between the light source and scale+gap amount between the scale and light receiving section).

[0235] The scale 24 is designed so that the laser beam of the beam emission port 22 b is diffracted by the pattern for detecting the reference position 24 b, and focused on the light receiving section 23 b, when the pattern for detecting the reference position 24 b is in a predetermined position with respect to the gap defined as described above.

[0236] Here, the base 21 and scale 24 are disposed so that the base and scale can move with respect to each other at a constant gap d in a pitch direction of the scale 24, that is, in an x direction of the surface light emitting laser 22. Moreover, a beam emission interval of the surface light emitting laser 22 is designed so that a phase difference of the position signal at a reference position detection time from the signal A is ½ of one period of the position signal. The surface light emitting laser 22 and photo IC 23 are both prepared in the semiconductor process, and the processing precision is several micrometers or less.

[0237]FIG. 13 is a block diagram showing the constitution of the signal processing circuit section (reference position detection circuit section) 6 in the encoder according to the fifth embodiment of the present invention. The signal processing circuit section (reference position detection circuit section) 6 includes: the phase interpolation circuit 105 for phase-dividing the analog position signals (a) and (b) to convert the signals to the digital signals (c) and (d); the binarizing circuit 102 for binarizing the signal for detecting the reference position (e) at the predetermined slice level to convert the signal to the digital signal for detecting the reference position (f); and the synchronous circuit 103 for synchronizing the digital signal for detecting the reference position (f) with the rise of the position signal (A) to generate the reference position signal (g). In FIG. 13, the rise of the position signal (A) is detected in the point passing the center of the amplitude as described later. The reference position signal (g) is obtained in synchronization with the rise of the position signal (A), but may be synchronized with an appropriate signal selected from the position signals (A), (B), (c), and (d).

[0238] [Operation]

[0239] First, a position detection function as an encoder will be described. The laser beam emitted from the surface light emitting laser 22 is incident upon the position detection pattern 24 a of the scale 24, and the laser beam reflected by the position detection pattern 24 a is detected by the light receiving array section 23 a. Moreover, when the base 21 and scale 24 move with respect to each other, intensity of an electric signal detected as a triangular wave by the light receiving array section 23 a changes. Since two electric signals (phase signals (A), (B)) detected by the light receiving array section 23 a have a phase difference of a ¼ period, these two signals can be used to know a movement amount of the relative movement of the base 21 and scale 24 including a relative movement direction. The position is detected by the input of the digital position signals (c) and (d) into the counter (not shown).

[0240] Next, a procedure of reference position detection will be described. FIG. 14 is a time chart showing that the input from the signal processing circuit 23 c (light receiving array section 23 a and light receiving section 23 b) is processed by the signal processing circuit section (reference position detection circuit section) 6 of FIG. 13. In FIG. 14, the horizontal axis indicates time, and shows the change of each signal when the displacement at the constant speed is caused.

[0241] That is, in the phase interpolation circuit 105, the analog position signals (A) and (B) of the encoder which periodically change with the displacement (relative movement of the scale 4) are phase-divided and binarized, so that the digital position signals (c) and (d) are obtained. In the binarizing circuit 102, the signal for detecting the reference position (e) is binarized at the predetermined slice level to obtain the digital signal for detecting the reference position (f). Moreover, in the synchronous circuit 103, the signal for detecting the reference position (f) is synchronized with the rise of the position signal (A) to obtain the high level, and synchronized with the level change of the position signal (d) to obtain the low level so that the reference position signal (g) is obtained.

[0242] Here, the position signals (c) and (d) have a phase difference of 90°.

[0243] Moreover, when the reference position signal (g) is generated, and the counter (not shown) for counting the reference position signal (g) is reset, it is possible to obtain the reference position of the position detection.

[0244] When the synchronous circuit is omitted, the digital signal for detecting the reference position (f) may be used as such as the reference position signal, or the digital signal for detecting the reference position (f) may be processed to obtain a sharp reference position signal in an intermediate point.

[0245] [Effect]

[0246] According to the present embodiment, the phase difference between the signal for detecting the reference position and the position signal can be set to an optimal value by the design beforehand. Moreover, the error is several micrometers or less in the precision by the semiconductor process. Therefore, it is possible to reduce the deviation of the reference position which could be caused by the unstable factors such as the signal noise or wobble, further stability of the light source, temperature characteristics of the light emitting/receiving device and fluctuations, and deviations from the designs of the individual encoders in the optical encoder.

[0247] Furthermore, when the reference position signal is synchronized, the tolerance for assembling/attaching can be increased. For example, because of the above-described unstable factors, the output level of the signal for detecting the reference position (e) shown in FIG. 14 may rise, the signal may shift in the left direction in FIG. 14, or the slice level may slightly drop. The tolerance against these increases, the deterioration of the reference position detection precision is inhibited, and it will become possible to stably detect the reference position.

[0248] Furthermore, in this embodiment, except the signal processing circuit section (reference position detection circuit section) 6, the member for generating the auxiliary signal for detecting the reference position is not disposed. Furthermore, as compared with the other embodiments, the changeover switch of the synchronous timing can be omitted. Therefore, the reference position can stably be detected, and it is possible to supply the small-sized and inexpensive encoder.

[0249] In the present embodiment, there are a plurality of reference position signal generating position candidates. When the synchronous circuit is omitted, the respective candidates are not virtual reference position candidates created by the synchronous circuit. At least some of the reference position candidates physically constitute an independent detection system. In this case, the candidates are not easily influenced by the shift of the detection position by the synchronization. Therefore, for example, the reference position is not easily influenced by the detection direction. Regardless of presence/absence of the synchronization, the interval of the reference position candidates changes by the way of selection of the value of i of Equation 1. Therefore, this is effective for a need to largely move the reference position in accordance with use conditions.

SIXTH EMBODIMENT

[0250] In a sixth embodiment, there is provided the encoder for detecting the positional displacement of the movable member. This generates a plurality of periodical signals in response to the movement of the movable member, and generates the signal for detecting the reference position, when the movable member is in a predetermined position. Moreover, characteristics lie in that one periodical signal can be selected from the periodical signals, and it is detected that the movable member is in the reference position based on the signal for detecting the reference position in synchronization with the selected periodical signal.

[0251] [Constitution]

[0252] The constitution of the signal processing circuit section in the encoder according to the sixth embodiment is similar to that of the signal processing circuit section in the above-described first embodiment, but is different in the function of the switch 104.

[0253] [Operation]

[0254]FIG. 15 is a time chart showing that the input from the photodetector 5 is processed by the signal processing circuit section 6 in the sixth embodiment. In FIG. 15, the position signals (a), (b), (c), and (d), signal for detecting the reference position (e), and digital signal for detecting the reference position (f) are similar to those of FIG. 3.

[0255] Moreover, one is selected from the following two methods to obtain the reference position signal (g) or (h). That is, in the first method, the digital signal for detecting the reference position (f) is synchronized with a fall of the position signal (c) to obtain the high level, and synchronized with the level change of the position signal (d) to obtain the low level, so that the reference position signal (g) is obtained. In the second method, the digital signal for detecting the reference position (f) is synchronized with the fall of the position signal (d) to obtain the high level, and synchronized with the level change of the position signal (c) to obtain the low level, so that the reference position signal (h) is obtained. The selection of the reference position signal (g) or (h) is carried out by the switch 104.

[0256] By the level change of the signal for detecting the reference position (e), the position and width of the digital signal for detecting the reference position (f) obtained by binarizing the signal for detecting the reference position (e) at the predetermined slice level change. By the change of the digital signal for detecting the reference position (f), the position of the reference position signal (g) changes, but the reference position signal (h) does not change.

[0257] [Effect]

[0258] Also according to the sixth embodiment, the effect similar to that in the above-described embodiments can be obtained.

SEVENTH EMBODIMENT

[0259] [Constitution]

[0260] The constitution of the major part of a seventh embodiment is not especially limited except the signal processing circuit section 6 as long as the position signal and the signal for detecting the reference position are obtained. For example, the general constitution may be used such as the optical encoder constitution shown as the constitution of the major part of the above-described first embodiment in FIG. 1. In the example of FIG. 1, the optical encoder has been described, but the other types such as the magnetic type may also be used.

[0261]FIG. 16 is a block diagram showing the constitution of the signal processing circuit section 6 of the encoder according to the seventh embodiment of the present invention. The signal processing circuit section 6 according to the seventh embodiment includes: the binarizing circuit 101 for converting the analog position signals (a) and (b) to the digital position signals (c) and (d); the binarizing circuit 102 for binarizing the signal for detecting the reference position (e) at the predetermined slice level to convert the signal to the digital signal for detecting the reference position (f); the synchronous circuit 103 for synchronizing the digital signal for detecting the reference position (f) from the binarizing circuit 102 with the digital position signals (c) and (d) from the binarizing circuit 101 to generate the reference position signal (g) or (h); the switch 104 for switching the timing of synchronization in the synchronous circuit 103; a judgment circuit 107 for detecting an optimal synchronous position; and a display 108 for displaying an optimal synchronous position judgment result by this judgment circuit 107.

[0262]FIG. 17 shows a constitution example of the synchronous circuit 103, and FIG. 18 shows the constitution example of the judgment circuit 107.

[0263] That is, the synchronous circuit 103 is constituted of: a rise detection section 103 g and fall detection section 103 h of the position signal (c); a selection switch 103 i for selecting output signals from these detection sections 103 g, 103 h in response to the changeover of the switch 104; and an AND circuit 103 j for obtaining the logical product of the output signal of the detection section 103 g or 103 h selected by the selection switch 103 i and the signal for detecting the reference position (f).

[0264] Moreover, in the judgment circuit 107, the position signal (d) and signal for detecting the reference position (f) are connected to data (D) and clock (CLK) of a flip flop (such as LS423) 107 a of a D-C trigger type. Moreover, the signal for detecting the reference position (f) is passed through a combination of a resistance 107 b and a capacitor 107 c which have a delay exceeding a signal delay of about 10 nanoseconds in the flip flop 107 a. Outputs of AND circuits 107 d and 107 e for obtaining the logical product of the output and outputs Q and {overscore (Q)} of the flip flop 107 a are outputted as the judgment result.

[0265] It is to be noted that in FIG. 16 the reference position signal (g) or (h) is obtained in synchronization with the position signals (c) and (d), but the similar function can also be realized in synchronization with the position signals (a) and (b).

[0266] [Operation]

[0267] A time chart when the input from the photodetector 5 shown in FIG. 1 is processed by the signal processing circuit section 6 of FIG. 16 is similar to that of FIG. 3 in the above-described first embodiment, and the following description will be made with reference to FIG. 3.

[0268] That is, in the binarizing circuit 101, the analog position signals (a) and (b) of the encoder which periodically change with the displacement (relative movement of the scale 4) are binarized to obtain the digital position signals (c) and (d). In the binarizing circuit 102, the signal for detecting the reference position (e) is binarized at the predetermined slice level to obtain the digital signal for detecting the reference position (f).

[0269] Moreover, one is selected from the following two methods to obtain the reference position signal. That is, in the first method, in the synchronous circuit 103, the digital signal for detecting the reference position (f) is synchronized with the rise of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (g) is obtained. Here, the rise of the position signal (a) or (c) is detected by the rise detection section 103 g, and the level change of the position signal (b) or (d) can be detected by a level change detection section (e.g., a low level detection circuit) (not shown). In the second method, in the synchronous circuit 103, the digital signal for detecting the reference position (f) is synchronized with the fall of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (h) is obtained. Here, the fall of the position signal (a) or (c) is detected by the fall detection section 103 h, and the level change of the position signal (b) or (d) can be detected by the level change detection section (not shown) (e.g., a high level detection circuit). One is selected from these two to output the reference position signal (g) or (h), and the selection is carried out by the switch 104.

[0270] Here, the position signals (a) and (c) have a phase difference of 90° from the position signals (b) and (d).

[0271] Moreover, the position signals (a) and (b) and the signal for detecting the reference position (e) which are analog signals may be signals of any type as long as the position signals (c) and (d) and the signal for detecting the reference position (f) which are digital signals can be created. The inputs from the photodetector 5 shown in FIG. 1 may be only the digital signals, and may not include any analog signal. When the inputted analog position signal is digitized, the resolution may be enhanced by the phase interpolation.

[0272] Moreover, the position detection is carried out by inputting the digital position signals (c) and (d) into the counter (not shown). In this case, when the reference position signal (g) or (h) is generated, the counter is reset, and it is accordingly possible to obtain the reference position of the position detection.

[0273] On the other hand, it is judged in the judgment circuit 107 which is closer to the phase of the position signal (c) between the nearest rise (assumed to be a phase of 0°) and the nearest fall (assumed to be a phase of 180°) when the signal for detecting the reference position (f) is detected, and the signal having a larger phase difference is regarded as stable and outputted. This optimal synchronous position judgment result is outputted to the display 108, or as an electric signal to the outside. It is to be noted that the display 108 may be of any type as long as results are shown. For example, an LED for the optimal among two LEDs indicating rise and fall edges may be lit when the reference position is detected. Alternatively, a display color of an LED which can be lit in two colors may be switched.

[0274] Here, a concrete judgment method will be described. First, the levels of the position signals (c) and (d) are confirmed. In the position signals (c) and (d) of FIG. 3, the phase of the position signal (c) is ahead by 90°. In this state, the level of the position signal (d) is the low level when the position signal (c) rises. Therefore, when the level of the position signal (d) is the low level, the phase difference till the rise of the position signal (c) is within ±90°. When the level of the position signal (d) is the high level, the phase difference till the rise of the position signal (c) is ±90° or more. Therefore, if the level of the position signal (d) is high level when the rise of the signal for detecting the reference position (f) is detected, it is more stable in synchronization with the rise of the position signal (c) against a slight fluctuation of the rise position of the signal for detecting the reference position (f) as compared with the case in which the level is low. By similar discussion, if the level of the position signal (d) is low level when the rise of the signal for detecting the reference position (f) is detected, it is more stable in synchronization with the fall of the position signal (c) against the slight fluctuation of the rise position of the signal for detecting the reference position (f) as compared with the case in which the level is high. Therefore, more stable synchronous position may be outputted as the judgment result.

[0275] For example, in FIG. 3, the level of the position signal (d) at the moment at which the signal for detecting the reference position (f) is detected (rise timing) is high level in an example of a bold line of the signal for detecting the reference position (e) (solid line of the signal for detecting the reference position (f)) from the figure. Therefore, concerning the rise and fall closest to the position signal (c), it is seen that the phase difference is larger and more stable at the rise, and the rise is outputted as the judgment result.

[0276] [Effect]

[0277] According to the present embodiment, it is possible to select the synchronous position with the position signal in accordance with the way of output of the signal for detecting the reference position. Therefore, it is possible to select the synchronous position which reduces the deviation of the reference position possibly caused by the unstable factors such as the signal noise or wobble, and further the stability of the light source, temperature characteristics of the light emitting/receiving device and fluctuations, and deviations from designs of individual encoders in the optical encoder. For example, it is considered that by the above-described unstable factors, the output level of the signal for detecting the reference position (e) of FIG. 3 rises, or shifts in the left direction in the figure, or the slice level slightly drops. At this time, assuming that the signal for detecting the reference position (e) changes to the fine line from the bold line, the digital signal for detecting the reference position (f) changes as shown by the broken line. Accordingly, the position deviating by one period as shown by the broken line in the reference position signal (h) is detected as the reference position signal. On the other hand, this change does not easily occur in the reference position signal (g). Therefore, when the reference position signal (g) is selected, the deterioration of the reference position detection precision is inhibited, and it is possible to stably detect the reference position.

[0278] Moreover, in the present embodiment, in order to synchronize the reference position signal with the position signal, there is disposed the judgment circuit 107 for judging a best synchronous position among the synchronous positions. In a state in which the encoder is actually attached to the apparatus, the best synchronous position can be selected. In this case, in the present embodiment, when the synchronous position having a larger phase allowance is selected, it is possible to enhance the stability against the fluctuation. Therefore, the stability of the reference position detection synchronized with the position signal increases. Moreover, the influences of the fluctuation of the relative position and posture, such as an attachment angle or gap of the head and scale at the attachment time of the encoder, do not have to be considered in advance. That is, the phase difference between the position signal and reference position signal does not have to be strictly set or processed in the design and manufacturing. Therefore, manufacturing cost or time for adjusting the assembly is reduced, and restrictions in the design and manufacturing are reduced. This produces an advantage that the degree of freedom in the function can increase.

[0279] Moreover, in the present embodiment, as judging means for selecting either the rise or the fall, a circuit for processing only two position signals in addition to the signal for detecting the reference position is used. At this time, the display 108 includes about two LEDs. A burden by addition is light, but the stability of the reference position detection synchronized with the position signal can easily be realized.

[0280] Furthermore, in the present embodiment, except the signal processing circuit section 6, the member for generating the auxiliary signal is not disposed for the reference position detection. Therefore, the reference position can stably be detected, and the small-sized and inexpensive encoder can be supplied.

EIGHTH EMBODIMENT

[0281] [Constitution]

[0282] In the same manner as in the seventh embodiment, the constitution of the major part of an eighth embodiment is not especially limited except the signal processing circuit section 6 as long as the position signal and the signal for detecting the reference position are obtained. For example, the general constitution may be used such as the optical encoder constitution shown as the constitution of the major part of the above-described first embodiment in FIG. 1. In the example of FIG. 1, the optical encoder has been described, but the other types such as the magnetic type may also be used.

[0283] Moreover, the constitution of the signal processing circuit section 6 in the eighth embodiment of the present invention may be similar to that of the block diagram shown in FIG. 16. Additionally, it is assumed that the synchronous circuit 103 and judgment circuit 107 in the signal processing circuit section 6 may include the following constitution.

[0284]FIGS. 19A to 20 are diagrams showing the constitution of the synchronous circuit 103. The circuit shown in FIG. 19A and the circuit shown in FIG. 20 can be switched by the switch 104. These circuits can easily and inexpensively be manufactured by a generally available logic ICs. FIG. 19B is a diagram showing a concrete constitution of the circuit of FIG. 19A. For the position signal which has the phase difference of 90°, when the detection direction changes, the progress of the phase is reversed. This can be used to distinguish the direction. That is, when the position signal (c) rises, the position signal (d) becomes low or high depending on the detection direction (stage movement direction). Therefore, when the level of the position signal (d) is defined, the direction can be identified. Then, in a detection circuit 103 k shown in FIG. 19A, the synchronization with the rise of the position signal (c) is established, and the detection is limited to a time when the position signal (d) indicates the low level, the direction of the reference position detection is limited. Moreover, the constitution of the synchronous circuit 103 synchronized with the fall of the position signal (c) in the same detection direction is shown in FIG. 20. That is, a stage movement direction when the position signal (c) detected by the detection circuit 103 k of FIG. 19A rises and the position signal (d) indicates the low level is the same as the stage movement direction when the position signal (c) detected by a detection circuit 103 l or FIG. 20 falls and the position signal (d) indicates the high level. The phase when the reference position is detected deviates by 180°. To switch this by the switch 104 is a purpose.

[0285]FIG. 21 is a diagram showing the constitution example of the judgment circuit 107 in the eighth embodiment. A flip flop 107 f of a D-C trigger type for distinguishing the direction is added to the constitution of FIG. 18 in the seventh embodiment. That is, in the flip flop 107 f for distinguishing the direction, the position signal (c) as the data D and the position signal (d) as the clock CLK are inputted. In the flip flop 107 a for distinguishing the optimal direction, the position signal (d) which is the data D and the signal for detecting the reference position (f) which is the clock CLK are inputted. Moreover, when an output Q of the flip flop 107 f, an output Q of the flip flop 107 a, and the signal for detecting the reference position (f) are all at the high level, judgment 1 which is the output of an AND circuit 107 d indicates the high level. Similarly, when an output {overscore (Q)} of the flip flop 107 f, an output {overscore (Q)} of the flip flop 107 a, and the signal for detecting the reference position (f) are all at the high level, a logical product is obtained in an AND circuit 107 e so that judgment 2 indicates the high level.

[0286] [Operation]

[0287] A time chart when the input from the photodetector 5 shown in FIG. 1 is processed by the signal processing circuit section 6 in the present embodiment is similar to that of FIG. 3 in the above-described first embodiment, and the following description will be made with reference to FIG. 3.

[0288] That is, in the binarizing circuit 101, the analog position signals (a) and (b) of the encoder which periodically change with the displacement (relative movement of the scale 4) are binarized to obtain the digital position signals (c) and (d). In the binarizing circuit 102, the signal for detecting the reference position (e) is binarized at the predetermined slice level to obtain the digital signal for detecting the reference position (f).

[0289] Moreover, one is selected from the following two methods to obtain the reference position signal. In the first method, in the detection circuit 103 k of the synchronous circuit 103, the digital signal for detecting the reference position (f) is synchronized with the rise of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (g) is obtained. In the second method, in the detection circuit 103 l of the synchronous circuit 103, the digital signal for detecting the reference position (f) is synchronized with the fall of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (h) is obtained. One is selected from these two to output the reference position signal (g) or (h), and the selection is carried out by the switch 104.

[0290] Here, the reference position signal (g) will be described in more detail with reference to FIG. 19B.

[0291] First, the direction distinction will be described. The position signal (d) is inputted into the data D of a flip flop 103 k 1, and the position signal (c) is inputted into the clock CLK. As a result, the signal outputted from the output {overscore (Q)} of the flip flop 103 k 1 is updated as a reversed signal of the position signal (d) at every rise of the position signal (c). Therefore, only when the position signal (d) indicates the low level at the time of the rise of the position signal (c), the output {overscore (Q)} of the flip flop 103 k 1 indicates the high level, and the direction distinction is therefore possible. Moreover, when an AND circuit 103 k 2 obtains the logical product of a detection direction distinction signal and the signal for detecting the reference position (f), the detection direction is correct and the signal for detecting the reference position (f) is in the detection state in a limited case.

[0292] Moreover, conditions for generating the reference position signal are further added. That is, in the present embodiment, the reference position signal is detected between the rise of the position signal (c) and the rise of the position signal (d). A rise edge of the position signal (c) is an important point, a detection width may be designated by time or by displacement amount of a measurement object, and the width itself may arbitrarily be designated. When the direction is designated, a case including the rise of the position signal (c) till the rise of the position signal (d) is equivalent to a case in which the position signal (c) has the high level and the position signal (d) has the low level. Therefore, the conditions are added.

[0293] That is, as described above, the reference position signal (g) is obtained by obtaining the logical product of four conditions that the position signal (c) has the high level, the position signal (d) has the low level, the position signal (d) has the low level at the time of the rise of the position signal (c) in the direction distinction, and the signal for detecting the reference position (f) has the high level (detecting state). That is, the logical product of the position signal (c) and the position signal (d) reversed in a NOT circuit 103 k 3 is obtained in an AND circuit 103 k 4, and the logical product of the outputs of the AND circuits 103 k 4 and 103 k 2 is obtained by an AND circuit 103 k 5 to obtain the reference position signal (g).

[0294] It is to be noted that the position signals (a) and (c) have a phase difference of 90° from the position signals (b) and (d). The position signals (a) and (b) and the signal for detecting the reference position (e) which are analog signals may be signals of any type as long as the position signals (c) and (d) and the signal for detecting the reference position (f) which are digital signals can be created. The inputs from the photodetector 5 shown in FIG. 1 may be only the digital signals, and may not include any analog signal. When the inputted analog position signal is digitized, the resolution may be enhanced by the phase interpolation.

[0295] Moreover, the position detection is carried out by inputting the digital position signals (c) and (d) into the counter (not shown). In this case, when the reference position signal (g) or (h) is generated, the counter is reset, and it is accordingly possible to obtain the reference position of the position detection.

[0296] It is to be noted that FIG. 6 shows the change of each signal when the displacement occurs in a direction opposite to that of FIG. 3. At this time, the progresses of the analog position signals (a) and (b) and the digital position signals (c) and (d) are reversed. When the displacement occurs in the opposite direction in this manner, the synchronous circuit 103 does not bring the reference position signals (g) and (h) into the detection state by the constitution and function shown in FIG. 19A (and FIG. 20). Therefore, the reference position is not detected in the displacement of the opposite direction. It is to be noted that when the synchronous circuit 103 shown in FIGS. 19A to 20 is appropriately designed, the reference position detection may also be possible only in the displacement of the opposite direction.

[0297] On the other hand, it is judged in the judgment circuit 107 which is closer to the phase of the position signal (c) between the nearest rise (assumed to be a phase of 0°) and the nearest fall (assumed to be a phase of 180°) when the signal for detecting the reference position (f) is detected, and the signal having a larger phase difference is regarded as stable and outputted. This optimal synchronous position judgment result is outputted to the display 108, or as the electric signal to the outside.

[0298] It is to be noted that the display 108 may be of any type as long as the results are shown. For example, for the LEDs indicating both the rise and fall, the optimal LED may be lit when the reference position is detected. Alternatively, the display color of the LED which can be lit in two colors may be switched.

[0299] Here, the concrete judgment method will be described. First, the levels of the position signals (c) and (d) are confirmed. In the position signals (c) and (d) of FIG. 3, the phase of the position signal (c) is ahead by 90°. In this state, the level of the position signal (d) at the time of the rise of the position signal (c) is the low level. Therefore, when the level of the position signal (d) is the low level, the phase difference till the rise of the position signal (c) is within ±90°. When the level of the position signal (d) is the high level, the phase difference till the rise of the position signal (c) is ±90° or more. Therefore, when the level of the position signal (d) at the time of the detection of the rise of the signal for detecting the reference position (f) is the low level, in synchronization with the rise of the position signal (c), the level is more stable with respect to the slight fluctuation of the rise position of the signal for detecting the reference position (f) as compared with the high level. By the similar discussion, when the level of the position signal (d) at the time of the detection of the rise of the signal for detecting the reference position (f) is the high level, in synchronization with the fall of the position signal (c), the level is more stable with respect to the slight fluctuation of the rise position of the signal for detecting the reference position (f) as compared with the low level. Therefore, more stable synchronous position may be outputted as the judgment result.

[0300] For example, in FIG. 3, the level of the position signal (d) at the moment at which the signal for detecting the reference position (f) is detected (rise timing) is high level in the example of the signals for detecting the reference position (e) and (f) in the figure. Therefore, concerning the closest rise and fall of the position signal (c), it is seen that the phase difference is larger and more stable at the fall, and the fall is outputted as the judgment result.

[0301] This judgment method is shown as a concrete circuit in FIG. 21. That is, in the flip flop 107 f the position signals (c) and (d) are used to perform the direction distinction, and the judgment result is outputted only when the position signal (c) indicates the high level at the rise of the position signal (d). Here, a case where the position signal (c) indicates the high level at the rise of the position signal (d) is equivalent to a case where the position signal (d) indicates the low level at the rise of the position signal (c). In the detection direction which is a designated direction, the judgment 1 is outputted as the result, when the level of the position signal (d) at the rise of the signal for detecting the reference position (f) is the high level. When the level of the position signal (d) is the low level, the judgment 2 is outputted as the result. The judgment 1 recommends that the reference position signal should be synchronized with the fall of the position signal (c), and the judgment 2 recommends that the reference position signal should be synchronized with the rise of the position signal (c).

[0302] [Effect]

[0303] According to the present embodiment, it is possible to select the synchronous position with the position signal in accordance with the way of output of the signal for detecting the reference position. Therefore, it is possible to select the synchronous position which reduces the deviation of the reference position possibly caused by the unstable factors such as the signal noise or wobble, and further the stability of the light source, temperature characteristics of the light emitting/receiving device and fluctuations, and deviations from designs of individual encoders in the optical encoder. For example, it is considered that by the above-described unstable factors, the output level of the signal for detecting the reference position (e) of FIG. 3 rises, or shifts in the left direction in the figure, or the slice level slightly drops. At this time, assuming that the signal for detecting the reference position (e) changes to the fine line from the bold line, the digital signal for detecting the reference position (f) changes as shown by the broken line. Accordingly, the position deviating by one period as shown by the broken line in the reference position signal (h) is detected as the reference position signal. On the other hand, this change does not easily occur in the reference position signal (g). Therefore, when the reference position signal (g) is selected, the deterioration of the reference position detection precision is inhibited, and it is possible to stably detect the reference position.

[0304] Moreover, in order to synchronize the reference position signal with the position signal, there is disposed the judgment circuit 107 for judging the best synchronous position among the synchronous positions. In the state in which the encoder is actually attached to the apparatus, the best synchronous position can be selected. In the present embodiment, when the synchronous position having a larger phase allowance is selected, it is possible to enhance the stability against the fluctuation. Therefore, the stability of the reference position detection synchronized with the position signal increases. Moreover, the influences of the fluctuation of the relative position and posture, such as the attachment angle or gap of the head and scale at the attachment time of the encoder, do not have to be considered in advance. That is, the phase difference between the position signal and reference position signal does not have to be strictly set or processed in the design and manufacturing. Therefore, the manufacturing cost or the time for adjusting the assembly is reduced, and the restrictions in the design and manufacturing are reduced. This produces the advantage that the degree of freedom in the function can increase.

[0305] Moreover, in the present embodiment, as the judging means for selecting either the rise or the fall, the circuit for processing only two position signals in addition to the signal for detecting the reference position is used. At this time, the display 108 includes about two LEDs. The burden by addition is light, but the stability of the reference position detection synchronized with the position signal can easily be realized.

[0306] Moreover, in the present embodiment, except the signal processing circuit section 6, the member for generating the auxiliary signal is not disposed for the reference position detection. Therefore, the reference position can stably be detected, and the small-sized and inexpensive encoder can be supplied.

[0307] Furthermore, as the effect peculiar to the eighth embodiment, the reference position detection is possible only when the displacement is caused in a given direction. This produces the advantages that the detection is not easily influenced by the backlashes of the movable part and the reference position does not have to be doubly detected at the reference position detection time. The reference position detection high in precision and convenient in use is possible.

NINTH EMBODIMENT

[0308] [Constitution]

[0309] According to a ninth embodiment of the present invention, the judging means of the optimal synchronous position as in the seventh embodiment is added to the third embodiment. In the same manner as in the seventh embodiment, the constitution of the major part of the ninth embodiment is not especially limited except the signal processing circuit section 6 as long as the position signal and the signal for detecting the reference position are obtained. For example, the general constitution may be used such as the optical encoder constitution shown as the constitution of the major part of the above-described first embodiment in FIG. 1. In the example of FIG. 1, the optical encoder has been described, but the other types such as the magnetic type may also be used.

[0310]FIG. 22 is a block diagram showing the constitution of the signal processing circuit section 6 of the encoder according to the ninth embodiment of the present invention. The signal processing circuit section 6 according to the ninth embodiment includes: the phase interpolation circuit 105 for phase-dividing the analog position signals (a) and (b) to convert the signals to the digital position signals (c) and (d); the binarizing circuit 102 for binarizing the signal for detecting the reference position (e) at the predetermined slice level to convert the signal to the digital signal for detecting the reference position (f); the latch circuit 106 for holding the rise of the digital signal for detecting the reference position (f) to obtain the latch signal (i); the synchronous circuit 103 for synchronizing the latch signal (i) from the latch circuit 106 with the position signal (a) and (d) to generate the reference position signal (g) or (h); the switch 104 for switching the timing of the synchronization in the synchronous circuit 103; the judgment circuit 107 for detecting the optimal synchronous position; and the display 108 for displaying the optimal synchronous position judgment result by this judgment circuit 107.

[0311] In the signal processing circuit section 6 including the constitution shown in FIG. 22, the rise/fall of the position signal (a) is detected in the point passing the center of the amplitude. The reference position signal (g) or (h) is obtained in synchronization with the position signals (a) and (d), but may be synchronized with the appropriate signal selected from the position signals (a), (b), (c), and (d).

[0312] [Operation]

[0313] A time chart when the input from the photodetector 5 shown in FIG. 1 is processed by the signal processing circuit section 6 of FIG. 22 is similar to that of FIG. 8 in the above-described third embodiment, and therefore the following description will be made with reference to FIG. 8.

[0314] That is, first, in the phase interpolation circuit 105, the analog position signals (a) and (b) which periodically change with the displacement are phase-divided and binarized to obtain the digital position signals (c) and (d). In the binarizing circuit 102, the signal for detecting the reference position (e) is binarized at the predetermined slice level to obtain the digital signal for detecting the reference position (f). Moreover, in the latch circuit 106, the rise of the digital signal for detecting the reference position (f) from the binarizing circuit 102 is detected to set the latch signal (i) to the high level.

[0315] Moreover, one is selected from the following two methods to obtain the reference position signal. In the first method, in the synchronous circuit 103, the signal is synchronized with the rise of the position signal (a) to obtain the high level, and synchronized with the level change of the position signal (d) to obtain the low level, so that the reference position signal is obtained. In the second method, in the synchronous circuit 103, the digital signal for detecting the reference position (f) is synchronized with the fall of the position signal (c) to obtain the high level, and synchronized with the level change of the position signal (d) to obtain the low level, so that the reference position signal is obtained. One is selected from these two methods to output the reference position signal (g) or (h), and this selection is carried out by the switch 104.

[0316] It is to be noted that the position signals (a) and (c) have a phase difference of 90° from the position signals (b) and (d). The position signals (a) and (b) and the signal for detecting the reference position (e) which are analog signals may be the signals of any type as long as the position signals (c) and (d) and the signal for detecting the reference position (f) which are digital signals can be created. Furthermore, the inputs may be only the digital signals, and may not include any analog signal.

[0317] Moreover, the position detection is carried out by inputting the digital position signals (c) and (d) into the counter (not shown). In this case, when the reference position signal (g) or (h) is generated, the counter is reset, and it is accordingly possible to obtain the reference position of the position detection.

[0318] On the other hand, it is judged in the judgment circuit 107 that the phase of the position signal (c) at the time of the detection of the signal for detecting the reference position (f) is in the vicinity of the closest rise (assumed to be the phase of 0°) or fall (assumed to be the phase of 180°), and the signal having a larger phase difference is regarded as stable and outputted. This optimal synchronous position judgment result is outputted to the display 108, or as the electric signal to the outside.

[0319] It is to be noted that the display 108 may be of any type as long as the results are shown. For example, for the LEDs indicating both the rise and fall, the optimal LED may be lit at the time of the reference position detection. Alternatively, the display color of the LED which can be lit in two colors may be switched.

[0320] Here, the concrete judgment method will be described. First, the levels of the position signals (c) and (d) are confirmed. In the position signals (c) and (d) of FIG. 8, the phase of the position signal (c) is ahead by 90°. In this state, the level of the position signal (d) at the time of the rise of the position signal (c) is the low level. Therefore, when the level of the position signal (d) is the low level at the time of the detection of the signal for detecting the reference position (f), the phase difference till the rise of the position signal (c) is within ±90°. When the level of the position signal (d) is the high level, the phase difference till the rise of the position signal (c) is ±90° or more. Therefore, when the level of the position signal (d) at the time of the detection of the rise of the signal for detecting the reference position (f) is the high level, in synchronization with the rise of the position signal (c), the level is more stable with respect to the slight fluctuation of the rise position of the signal for detecting the reference position (f) as compared with the synchronization with the fall. By the similar discussion, when the level of the position signal (d) at the time of the detection of the rise of the signal for detecting the reference position (f) is the low level, in synchronization with the fall of the position signal (c), the level is more stable with respect to the slight fluctuation of the rise position of the signal for detecting the reference position (f) as compared with the synchronization with the rise. Therefore, more stable synchronous position may be outputted as the judgment result.

[0321] For example, in FIG. 8, the level of the position signal (d) at the moment at which the signal for detecting the reference position (f) is detected (rise timing) is high level in the example of the signals for detecting the reference position (e) and (f) in the figure. Therefore, concerning the closest rise and fall of the position signal (c), it is seen that the phase difference is larger and more stable at the rise, and the rise is outputted as the judgment result.

[0322] [Effect]

[0323] According to the present embodiment, it is possible to select the synchronous position with the position signal in accordance with the way of output of the signal for detecting the reference position. Therefore, it is possible to select the synchronous position which reduces the deviation of the reference position possibly caused by the unstable factors such as the signal noise or wobble, and further the stability of the light source, temperature characteristics of the light emitting/receiving device and fluctuations, and deviations from designs of individual encoders in the optical encoder.

[0324] Furthermore, as the effect peculiar to the ninth embodiment, the signal for detecting the reference position (e) is held by the latch circuit 106, and it is therefore possible to establish the synchronization with the periodical signal, even when the detection width of the signal for detecting the reference position (f) is reduced, and even after the detection state is eliminated. Therefore, the tolerance is enhanced even against the change of the output level of the signal for detecting the reference position (e) of FIG. 8, shift in the left/right direction in the figure, or the change of the slice level by the above-described unstable factors. Moreover, when the rise position of the latch signal (i) can be designed/disposed in a position ahead of the synchronous position of the position signal (c) by the phase of about 180°, an allowance of ±180° is produced. That is, there is the position deviation tolerance of ±½ times the pitch of the position signal. Even when it is difficult to set the phase difference between the rise position of the latch signal (i) and the synchronous position of the phase A, the allowance of ±90° or more is generated by selecting the synchronous position. Therefore, when the reference position signal (g) or (h) is selected, the deterioration of the reference position detection precision is inhibited, and the stable reference position detection is possible.

[0325] Moreover, in the present embodiment, in order to synchronize the reference position signal with the position signal, there is disposed the judgment circuit 107 for judging the best synchronous position among the synchronous positions. In the state in which the encoder is actually attached to the apparatus, the best synchronous position can be selected. In this case, in the present embodiment, when the synchronous position having a larger phase allowance is selected, it is possible to enhance the stability against the fluctuation. Therefore, the stability of the reference position detection synchronized with the position signal increases. Moreover, the influences of the fluctuation of the relative position and posture, such as an attachment angle or gap of the head and scale at the attachment time of the encoder, do not have to be considered in advance. That is, the phase difference between the position signal and reference position signal does not have to be strictly set or processed in the design and manufacturing. Therefore, the manufacturing cost or time for adjusting the assembly is reduced, and the restrictions in the design and manufacturing are reduced. This produces an advantage that the degree of freedom in the function can increase.

[0326] Moreover, in the present embodiment, as the judging means for selecting either the rise or the fall, the circuit for processing only two position signals in addition to the signal for detecting the reference position is used. At this time, the display 108 also includes about two LEDs. The burden by addition is light, but the stability of the reference position detection synchronized with the position signal can easily be realized.

[0327] Furthermore, in the present embodiment, except the signal processing circuit section 6, the member for generating the auxiliary signal is not disposed for the reference position detection. Therefore, the reference position can stably be detected in real time, and the small-sized and inexpensive encoder can be supplied.

[0328] Furthermore, with the synchronization method with the position signal of the detection direction, including a limiting function, as described in the eighth embodiment, the reference position detection is possible only when the displacement is caused in the given direction. This produces the advantages that the detection is not easily influenced by the backlashes of the movable part and the reference position does not have to be doubly detected at the reference position detection time. The reference position detection high in precision and convenient in use is possible.

TENTH EMBODIMENT

[0329] [Constitution]

[0330] According to a tenth embodiment of the present invention, the judging means of the optimal synchronous position as in the seventh embodiment is added to the fourth embodiment. Since the major constitution of the encoder according to the present embodiment is similar to that of the fourth embodiment, the description is omitted.

[0331]FIG. 23 is a block diagram showing the constitution of the signal processing circuit section 6 of the encoder according to the tenth embodiment. That is, the signal processing circuit section 6 includes: the binarizing circuit 101 for converting the analog position signals (a) and (b) to the digital position signals (c) and (d); the binarizing circuit 102 for binarizing the signals for detecting the reference position (e1), (e2), and (e3) at the predetermined slice level to convert the signals to the digital signals for detecting the reference position (f1), (f2), and (f3); the synchronous circuit 103 for synchronizing one of the digital signals for detecting the reference position (f1), (f2), and (f3) from the binarizing circuit 102 with the digital position signals (c) and (d) from the binarizing circuit 101 to generate the reference position signal (g); the switch 104 for switching the timing of the synchronization in the synchronous circuit 103; the judgment circuit 107 for detecting the optimal synchronous position; and the display 108 for displaying the optimal synchronous position judgment result by the judgment circuit 107.

[0332] It is to be noted that in the state of FIG. 23, the reference position signal (g) is detected in synchronization with the position signal (a), but this can also be realized in synchronization with the position signal (b), (c), or (d) with the similar function.

[0333] [Operation]

[0334] Since a time chart showing that the input from the photodetector 5 shown in FIG. 9 is processed by the signal processing circuit section 6 of FIG. 23 is similar to that of FIG. 11 in the fourth embodiment, the following description will be made with reference to FIG. 11.

[0335] That is, in the binarizing circuit 101, the analog position signals (a) and (b) of the encoder which periodically change with the displacement are binarized to obtain the digital position signals (c) and (d). In the binarizing circuit 102, the signals for detecting the reference position (e1), (e2), and (e3) are binarized at the predetermined slice level to obtain the digital signals for detecting the reference position (f1), (f2), and (f3). Moreover, in the synchronous circuit 103, one of these digital signals for detecting the reference position (f1), (f2), and (f3) is selected in response to the switch 104. In this case, in the synchronous circuit 103, when the selected digital signal for detecting the reference position is brought in the detection state, the signal is synchronized with the rise of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (g) is obtained. It is to be noted that in FIG. 11, the detection state parts of the reference position signal (g) corresponding to the digital signals for detecting the reference position (f1), (f2), and (f3) correspond to parts of the solid line, fine dotted line, and dotted line in the pulse-shaped parts.

[0336] Here, the position signals (a) and (c) have the phase difference of 90° from the position signals (b) and (d). The position signals (a) and (b) and the signals for detecting the reference position (e1), (e2), and (e3) which are analog signals may be signals of any type as long as the position signals (c) and (d) and the signals for detecting the reference position (f1), (f2), and (f3) which are digital signals can be created. Furthermore, the inputs from the detection system are only the digital signals, and may not include any analog signal. When the position signal is digitized, the resolution may be enhanced by the phase interpolation.

[0337] The position detection is carried out by inputting the digital position signals (c) and (d) into the counter (not shown). Moreover, when the reference position signal (g) is generated, the counter is reset, and it is accordingly possible to obtain the reference position of the position detection.

[0338] On the other hand, in the judgment circuit 107, the signal for detecting the reference position having the largest phase difference with respect to the closest rise of the position signal (c) at the time of the detection of the signal for detecting the reference position (f1), (f2), or (f3), that is, having a phase allowance is judged as stable and outputted. This optimal synchronous position judgment result is outputted to the display 108, or as the electric signal to the outside. It is to be noted that the display 108 may be of any type as long as the results are shown. For example, for three LEDs indicating the respective signals for detecting the reference position, the optimal LED may be lit at the time of the reference position detection. Alternatively, the display color of the LED which can be lit in three colors may be switched. It is to be noted that when it is judged that there are two stable alternatives, the alternatives are not necessarily limited to one, and two alternatives may simultaneously be displayed.

[0339] Here, the concrete judgment method will be described. In the position signals (a), (b), (c), and (d) of FIG. 11, the position signals (b) and (d) are ahead of the position signals (a) and (c) by the phase of 90°. These will be described with reference to FIGS. 24A and 24B. When a combination of the signal levels of the position signals (a) and (b) of FIG. 11 is represented in a two-dimensional graph, the signals move clockwise on circumferences of FIGS. 24A and 24B. Here, the level of the position signal (a) changes to be plus from minus. That is, the rise of the position signal (c) corresponds to an upper point, on the plus side of the position signal (b), among intersections of the vertical axis and the circle shown by arrows in FIGS. 24A and 24B. The position farthest from this point at the time of the detection of the signal for detecting the reference position can be said to be most stable even against the fluctuation of the system. The three points (f1), (f2), and (f3) in FIGS. 24A and 24B show the positions of the position signals (a) and (b) at the moment of the detection of the signals for detecting the reference position (f1), (f2), and (f3).

[0340] When the level of the position signal (d) at the time of the detection of the signal for detecting the reference position is the low level, that is, when the position signal at the detection time of the signal for detecting the reference position exists in a lower half on the circumference, there is a phase allowance of at least 90° or more, and the position is stable. The phase difference of the respective signals for detecting the reference position is known as about 120°. Therefore, the number of the signals for detecting the reference position at which the level of the position signal (d) at the time of the detection of the signal for detecting the reference position is the low level is one or two.

[0341] When the number of the signals for detecting the reference position, satisfying the conditions, is one as in the example of FIG. 24A, the signal may be judged as an optimal detection signal.

[0342] On the other hand, as in the example of FIG. 24B, when there are two signals for detecting the reference position, satisfying the conditions, both the signals may be regarded as stable. Here, two signals are further limited to one as follows. That is, in the example of FIG. 24B, there is only one signal for detecting the reference position (f2) at which the level of the position signal (d) is the high level. Since the phase difference of each signal for detecting the reference position is known and about 120°, the signal for detecting the reference position (f1) corresponding to a point (f1) having an opposite level (high level) with respect to the level (low level) of the position signal (a) (i.e., the position signal (c)) in a corresponding point (f2) can be judged as the most stable signal for detecting the reference position.

[0343] [Effect]

[0344] According to the present embodiment, when one is selected from a plurality of signals for detecting the reference position, it is possible to select the synchronous position with the position signal. Therefore, it is possible to select the synchronous position which reduces the deviation of the reference position possibly caused by the unstable factors such as the signal noise or wobble, and further the stability of the light source, temperature characteristics of the light emitting/receiving device and fluctuations, and the deviations from designs of individual encoders in the optical encoder. For example, it is supposed that by the above-described unstable factors, the output levels of the signals for detecting the reference position (e1), (e2), and (e3) shown in FIG. 11 change, or shift in the left/right direction in the figure, or the slice level slightly increases/decreases. At this time, the reference position signal (g) generated using the signals for detecting the reference position (e1) and (e3) is relatively stable. With the use of the signal for detecting the reference position (e2), since the signal is in the vicinity of the synchronous circuit with the position signal, the signal easily becomes unstable. In this case, the difference for one period is sometimes generated in the obtained reference position. However, when only one of the signals is constantly used, there is no practical problem. It is to be noted that as the way of synchronization, there is also a method for measuring the displacement in the vicinity of the reference position while synchronizing the signal for detecting the reference position with the position signal. In this case, the signal for detecting the reference position (e2) having a small difference is preferably used. In this case, there is a tolerance of detection position deviation for ±1 period at maximum. Therefore, when the reference position signal (g) is selected by the above-described method, the deterioration of the reference position detection precision is inhibited, and the stable reference position detection is possible.

[0345] Moreover, in the present embodiment, in order to synchronize the reference position signal with the position signal, there is disposed the judgment circuit 107 for judging the best signal for detecting the reference position among the signals for detecting the reference position. In the state in which the encoder is actually attached to the apparatus, the best synchronous position can be selected. In this case, in the present embodiment, when the synchronous position having a larger phase allowance is selected, it is possible to enhance the stability against the fluctuation. Therefore, the stability of the reference position detection synchronized with the position signal increases. Moreover, the influences of the fluctuation of the relative position and posture, such as the attachment angle or gap of the head and scale at the attachment time of the encoder, do not have to be considered in advance. That is, the phase difference between the position signal and reference position signal does not have to be strictly set or processed in the design and manufacturing. Therefore, the manufacturing cost or time for adjusting the assembly is reduced, and the restrictions in the design and manufacturing are reduced. This produces an advantage that the degree of freedom in the function can increase.

[0346] Moreover, in the present embodiment, as the judging means for selecting any of three signals for detecting the reference position, the circuit for processing only two position signals in addition to the signal for detecting the reference position is used. At this time, the display 108 also includes about three LEDs. The burden by addition is light, but the stability of the reference position detection synchronized with the position signal can easily be realized.

ELEVENTH EMBODIMENT

[0347] [Constitution]

[0348] An eleventh embodiment of the present invention will next be described. In the same manner as in the eighth embodiment, the major constitution of the encoder according to the present embodiment except the signal processing circuit section 6 is not especially limited as long as the position signal and the signal for detecting the reference position are obtained. For example, the general constitution may be used such as the optical encoder constitution shown as the constitution of the major part of the above-described first embodiment in FIG. 1. In the example of FIG. 1, the optical encoder has been described, but the other types such as the magnetic type may also be used.

[0349] Moreover, the signal processing circuit section 6 in the eleventh embodiment is constituted as shown in FIG. 25. That is, the signal processing circuit section 6 according to the eleventh embodiment includes: the binarizing circuit 101 for converting the analog position signals (a) and (b) to the digital position signals (c) and (d); the binarizing circuit 102 for binarizing the signal for detecting the reference position (e) at the predetermined slice level to convert the signal to the digital signal for detecting the reference position (f); the synchronous circuit 103 for synchronizing the digital signal for detecting the reference position (f) from the binarizing circuit 102 with the digital position signals (c) and (d) from the binarizing circuit 101 to generate the reference position signal (g) or (h); the switch 104 for switching the timing of the synchronization in the synchronous circuit 103; the judgment circuit 107 for detecting the optimal synchronous position; the display 108 for displaying the optimal synchronous position judgment result by this judgment circuit 107; and a storage unit 109 in which the optimal synchronous position judgment result by the judgment circuit 107 is stored and the switch 104 can be switched by a command.

[0350] Furthermore, in the present embodiment, a reference signal (j) is further given. The reference signal (j) is a reference signal which indicates an amplitude center level of the position signals (a) and (b), and is used in the binarizing circuit 101 and judgment circuit 107. For example, when the position signals (a) and (b) are designed so as to change in a range of −5 V to 5 V, the reference signal (j) indicates 0 V. When the position signals (a) and (b) are designed so as to change in a range of 0 V to 5 V, the reference signal indicates 2.5 V.

[0351] It is to be noted that the binarizing circuit 101 does not have to necessarily obtain a binarized signal, and may also obtain a digitized signal of a plurality of bits. With the signal of the bits, only an uppermost code bit is extracted in order to extract binarized data, and then the equal processing is subsequently possible.

[0352] Moreover, the constitution of the synchronous circuit 103 in the signal processing circuit section 6 may be similar to that of FIGS. 19A to 20. On the other hand, the judgment circuit 107 includes a constitution shown in FIG. 26 or 27.

[0353] That is, in the constitution shown in FIG. 26, the position signal (b) is inputted into a reverse circuit 107 g which is constituted using an OP amplifier and two resistances having an equal resistance value and in which the reference signal (j) is a reference. The position signals (a) and (b) are inputted into a first comparator 107 h, and the position signal (a) and the reversed signal of the position signal (b), prepared in the reverse circuit 107 g, are inputted into a second comparator 107 i. Moreover, the outputs from these two comparators 107 h, 107 i are inputted into an AND circuit 107 j, XOR circuit 107 k, and NOR circuit 107 l, and the outputs of these three logic circuits 107 j, 107 k, 107 l are inputted into a latch circuit 107 m. On the other hand, the position signal (c) which is the data D, and the position signal (d) which is the clock CLK are inputted into the flip flop 107 f such as LS423 of a D-C trigger type. Moreover, the output Q of the flip flop 107 f and the signal for detecting the reference position (f) are inputted into the AND circuit 107 d, and the result is inputted into the trigger of the latch circuit 107 m. Therefore, three signals latched at the rise of this trigger signal are obtained as the optimal synchronous position judgment results (judgments 1 to 3).

[0354] Moreover, in the constitution shown in FIG. 27, the position signal (b) is inputted into the reverse circuit 107 g which is constituted using the OP amplifier and two resistances having the equal resistance value and in which the reference signal (j) is the reference. The position signals (a) and (b) are inputted into the first comparator 107 h, and the position signal (a) and the reversed signal of the position signal (b), prepared in the reverse circuit 107 g, are inputted into the second comparator 107 i. Moreover, the outputs from these two comparators 107 h, 107 i and reversed signals of the outputs are inputted into four AND circuits as follows. That is, the outputs of the comparators 107 h and 107 i are inputted into an AND circuit 107 n. The reversed signal obtained by reversing the output of the comparator 107 h in an NOT circuit 107 p, and the output of the comparator 107 i are inputted into an AND circuit 107 o. The output of the comparator 107 h, and the reversed signal obtained by reversing the output of the comparator 107 i in a NOT circuit 107 r are inputted into an AND circuit 107 q. Moreover, the reversed signal obtained by reversing the output of the comparator 107 h in a NOT circuit 107 o, and the reversed signal obtained by reversing the output of the comparator 107 i in the NOT circuit 107 r are inputted into an AND circuit 107 s. Here, the outputs of these AND circuits 107 n, 107 o, 107 q, 107 s are obtained as signals (p), (q), (r), (s).

[0355] Furthermore, these signals (p) to (s), the position signals (c) and (d), and the reversed signals of these position signals (c) and (d) are inputted into eight AND circuits as follows. That is, the signal (p) and position signal (d) are inputted into an AND circuit 107 t, the signal (q) and position signal (c) are inputted into an AND circuit 107 u, the signal (r) and position signal (c) are inputted into an AND circuit 107 v, and the signal (s) and position signal (d) are inputted into an AND circuit 107 w. The signal (p) and the reversed signal obtained by reversing the position signal (d) in a NOT circuit 107 y are inputted into an AND circuit 107 x, the signal (q) and the reversed signal obtained by reversing the position signal (c) in a NOT circuit 107A are inputted into an AND circuit 107 z, the signal (r) and the reversed signal of the position signal (c) are inputted into an AND circuit 107B, and the signal (s) and the reversed signal of the position signal (d) are inputted into the AND circuit 107C. Moreover, the outputs of these eight AND circuits 107 t to 107 x, 107 z, 107B, 107C are inputted into the latch circuit 107 m.

[0356] On the other hand, the position signal (c) which is the data D, and the position signal (d) which is the clock CLK are inputted into the flip flop 107 f such as LS423 of the D-C trigger type. Moreover, the output Q of the flip flop 107 f and the signal for detecting the reference position (f) are inputted into the AND circuit 107 d, and a signal (k) which is the result is inputted into the trigger of the latch circuit 107 m. Therefore, eight signals latched at the rise of this trigger signal are obtained as the optimal synchronous position judgment results (judgments 1 to 8).

[0357] Moreover, the storage unit 109 is mainly constituted of nonvolatile storage mediums such as SRAM and flash ROM, and also constituted of a logic array or CPU for processing the judgment result or for the input/output if necessary. In the storage unit 109, the judgment result from the judgment circuit 107 is stored, and the stored judgment result is outputted to the outside in response to the command from the outside. When the judgment result is sent to the switch 104, the position is switched to the synchronous position where the synchronous circuit 103 is judged as optimal.

[0358] [Operation]

[0359] A time chart when the input from the photodetector 5 shown in FIG. 1 is processed by the signal processing circuit section 6 in the present embodiment is similar to that of FIG. 3 in the above-described first embodiment, and therefore the following description will be made with reference to FIG. 3.

[0360] That is, in the binarizing circuit 101, the analog position signals (a) and (b) of the encoder which periodically change with the displacement (relative movement of the scale 4) are binarized to obtain the digital position signals (c) and (d). In the binarizing circuit 102, the signal for detecting the reference position (e) is binarized at the predetermined slice level to obtain the digital signal for detecting the reference position (f).

[0361] Moreover, one is selected from the following two methods to obtain the reference position signal. In the first method, in the detection circuit 103 k of the synchronous circuit 103, the digital signal for detecting the reference position (f) is synchronized with the rise of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (g) is obtained. Here, the level changes of the position signals (a) and (b) which are the analog signals indicate a level change of the reference signal (j) upwards from the lower level or downwards from the upper level. In the second method, in the detection circuit 103 l of the synchronous circuit 103, the digital signal for detecting the reference position (f) is synchronized with the fall of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (h) is obtained. One is selected from these two to output the reference position signal (g) or (h), and the selection is carried out by the switch 104.

[0362] Here, the reference position signal (g) will be described in more detail with reference to FIG. 19B.

[0363] First, the direction distinction will be described. The position signal (d) is inputted into the data D of the flip flop 103 k 1, and the position signal (c) is inputted into the clock CLK. As a result, the signal outputted from the output {overscore (Q)} of the flip flop 103 k 1 is updated as the reversed signal of the position signal (d) at every rise of the position signal (c). Therefore, only when the position signal (d) indicates the low level at the time of the rise of the position signal (c), the output {overscore (Q)} of the flip flop 103 k 1 indicates the high level, and the direction distinction is therefore possible. Moreover, when the AND circuit 103 k 2 obtains the logical product of the detection direction distinction signal and the signal for detecting the reference position (f), the detection direction is correct and the signal for detecting the reference position (f) is in the detection state in the limited case.

[0364] Moreover, the conditions for generating the reference position signal are further added. That is, in the present embodiment, the reference position signal is detected between the rise of the position signal (c) and the rise of the position signal (d). The rise edge of the position signal (c) is an important timing, the detection width may be designated by the time or by the displacement amount of the measurement object, and the width itself may arbitrarily be designated. When the direction is designated, the case including the rise of the position signal (c) till the rise of the position signal (d) is equivalent to the case where the position signal (c) has the high level and the position signal (d) has the low level. Therefore, the conditions are added.

[0365] That is, from the above, the reference position signal (g) is obtained by obtaining the logical product of four cases where the position signal (c) indicates the high level, the position signal (d) indicates the low level, the position signal (d) indicates the low level at the rise of the position signal (c) in the direction distinction, and the signal for detecting the reference position (f) indicates the high level (detecting state).

[0366] It is to be noted that the position signals (a) and (c) have a phase difference of 90° from the position signals (b) and (d). The position signals (a) and (b) and the signal for detecting the reference position (e) which are analog signals may be signals of any type as long as the position signals (c) and (d) and the signal for detecting the reference position (f) which are digital signals can be created. The inputs from the photodetector 5 shown in FIG. 1 may be only the digital signals, and may not include any analog signal. When the inputted analog position signal is digitized, the resolution may be enhanced by the phase interpolation.

[0367] Moreover, the position detection is carried out by inputting the digital position signals (c) and (d) into the counter (not shown). In this case, when the reference position signal (g) or (h) is generated, the counter is reset, and it is accordingly possible to obtain the reference position of the position detection.

[0368] It is to be noted that FIG. 6 shows the change of each signal when the displacement occurs in the direction opposite to that of FIG. 3. At this time, the progresses of the analog position signals (a) and (b) and the digital position signals (c) and (d) are reversed. When the displacement occurs in the opposite direction in this manner, the synchronous circuit 103 does not bring the reference position signals (g) and (h) into the detection state by the constitution and function shown in FIG. 19A (and FIG. 20). Therefore, the reference position is not detected in the displacement of the opposite direction. It is to be noted that when the synchronous circuit 103 shown in FIGS. 19A to 20 is appropriately designed, the reference position detection may also be possible only in the displacement of the opposite direction.

[0369] On the other hand, it is judged in the judgment circuit 107 that the phase of the position signal (c) at the time of the detection of the signal for detecting the reference position (f) is in the vicinity of the closest rise (assumed to be the phase of 0°) or fall (assumed to be the phase of 180°) in a stepwise manner, and the signal having a larger phase difference is regarded as stable and outputted. This optimal synchronous position judgment result is outputted to the display 108, and stored in the storage unit 109.

[0370] Here, with reference to FIGS. 28A and 28B, area dividing for the judgment will be described. It is to be noted that in these figures, the horizontal axis shows the level of the position signal (a), and the vertical axis shows the level of the position signal (b). Since two position signals (a) and (b) have a phase difference of 90° and equal amplitude, a point determined by two position signals at a certain time is on The circumference of the Lissajous circle having a radius of ½ of the amplitude. This point moves clockwise or counterclockwise on the Circumference of the Lissajous circle with time by an amount corresponding to the displacement. A synchronous position 1 in FIGS. 28A and 28B corresponds to the rises of the position signals (a) and (c), and a synchronous position 2 corresponds to the falls of the position signals (a) and (c).

[0371] In FIG. 28A, an area is divided into areas (1) to (4) counterclockwise from a positive side of the position signal (a) of a first quadrant. When it is judged that the point determined by the position signals (a) and (b) in the rise of the signal for detecting the reference position (f) exists in any of the areas (1) to (4), the synchronous position is determined. That is, when the point is in the area (2), the phase difference with respect to the synchronous position 1 is large, and the synchronous position 1 is therefore obtained as the judgment result. When the point is in the area (1) or (3), there is an allowance of 45° or more with respect to either of the synchronous positions 1, 2, and therefore the judgment result indicates that either position may be determined. Moreover, when the point is in the area (4), the phase difference with respect to the synchronous position 2 is large, and the synchronous position 2 is therefore obtained as the judgment result.

[0372] For this area dividing, when the judgment circuit 107 including the constitution of FIG. 26 is used, the following two judgments are performed.

Position signal (a)>position signal (b)   (Logical Formula 1)

Position signal (a)<reversed signal of the position signal (b)   (Logical Formula 2)

[0373] With respect to Logical Formulas 1 and 2, the judgment is performed in three cases where both the formulas are true, only one is true, and both are false. In a predetermined moving direction, and at the rise of the signal for detecting the reference position (f), the judgment result is latched and outputted.

[0374] Moreover, in FIG. 28B, the area is divided into areas (1) to (8) counterclockwise from the positive side of the position signal (a) of the first quadrant. When it is judged that the point determined by the position signals (a) and (b) in the rise of the signal for detecting the reference position (f) exists in any of the areas (1) to (8), the synchronous position is determined. That is, when the point is in the area (2) or (3), the phase difference with respect to the synchronous position 1 is large, and the synchronous position 1 is therefore obtained as the judgment result. When the point is in the area (1) or (4), there is an allowance of 90° or more rather with respect to the synchronous position 1, and therefore the judgment result rather with the synchronous position 1 is obtained. When the point is in the area (5) or (8), there is an allowance of 90° or more rather with respect to the synchronous position 2, and therefore the judgment result rather with the synchronous position 2 is obtained. Moreover, when the point is in the area (6) or (7), the phase difference with respect to the synchronous position 2 is large, and the synchronous position 2 is therefore obtained as the judgment result.

[0375] As described above, eight areas may be reduced to four and used in the judgment. In this case, the respective judgment results of FIG. 27 may be arranged using the AND circuit with respect to segments described above.

[0376] For this area dividing, when the judgment circuit 107 including the constitution of FIG. 26 is used, the following four judgments are performed.

Position signal (a)>position signal (b)   (Logical Formula 3)

Position signal (a)<reversed signal of the position signal   (b) (Logical Formula 4)

Level (true/false) of the position signal (c)   (Logical Formula 5)

Level (true/false) of the position signal (d)   (Logical Formula 6)

[0377] There are eight true/false combinations possibly taken by these Logical Formulas 3, 4, 5, and 6.

[0378] The judgment is performed in the cases where both are true, only one is true, and both are false. In the predetermined moving direction, and at the rise of the signal for detecting the reference position (f), the judgment result is latched and outputted.

[0379] It is to be noted that the display 108 may be of any type as long as the results are shown. For example, the display includes a plurality of LEDs, and the LED corresponding to the optimal rise or fall, and the LED showing the stability may be lit at the time of the reference position detection. The LED corresponding to not only the stability but also a phase relation can be lit.

[0380] [Effect]

[0381] It is possible to select the synchronous position with the position signal in accordance with the way of the output of the signal for detecting the reference position. Therefore, it is possible to select the synchronous position which reduces the deviation of the reference position possibly caused by the unstable factors such as the signal noise or wobble, and further the stability of the light source, temperature characteristics of the light emitting/receiving device and fluctuations, and deviations from designs of individual encoders in the optical encoder. For example, it is considered that by the above-described unstable factors, the output level of the signal for detecting the reference position (e) of FIG. 3 rises, or shifts in the left direction in the figure, or the slice level slightly drops. At this time, assuming that the signal for detecting the reference position (e) changes to the fine line from the bold line, the digital signal for detecting the reference position (f) changes as shown by the broken line. Accordingly, the position deviating by one period as shown by the broken line in the reference position signal (h) is detected as the reference position signal. On the other hand, this change does not easily occur in the reference position signal (g). Therefore, when the reference position signal (g) is selected, the deterioration of the reference position detection precision is inhibited, and it is possible to stably detect the reference position.

[0382] Moreover, in order to synchronize the reference position signal with the position signal, there is disposed the judgment circuit 107 for judging the best synchronous position among the synchronous positions. In the state in which the encoder is actually attached to the apparatus, the best synchronous position can be selected. In the present embodiment, when the synchronous position having a larger phase allowance is selected, it is possible to enhance the stability against the fluctuation. Therefore, the stability of the reference position detection synchronized with the position signal increases. Moreover, the influences of the fluctuation of the relative position and posture, such as the attachment angle or gap of the head and scale at the attachment time of the encoder, do not have to be considered in advance. That is, the phase difference between the position signal and reference position signal does not have to be strictly set or processed in the design and manufacturing. Therefore, the manufacturing cost or time for adjusting the assembly is reduced, and the restrictions in the design and manufacturing are reduced. This produces the advantage that the degree of freedom in the function can increase.

[0383] Moreover, in the present embodiment, as the judging means for selecting either the rise or the fall, the circuit for processing only two position signals in addition to the signal for detecting the reference position is used. At this time, the display 108 also includes about two LEDs. The burden by addition is light, but the stability of the reference position detection synchronized with the position signal can easily be realized.

[0384] Furthermore, in the present embodiment, except the signal processing circuit section 6, the member for generating the auxiliary signal is not disposed for the reference position detection. Therefore, the reference position can stably be detected, and the small-sized and inexpensive encoder can be supplied.

[0385] Furthermore, the reference position detection is possible only when the displacement is caused in the given direction. This produces the advantages that the detection is not easily influenced by the backlashes of the movable part and the reference position does not have to be doubly detected at the reference position detection time. The reference position detection high in precision and convenient in use is possible.

[0386] Additionally, in the present embodiment, a behavior of the system can be confirmed from the judgment result successively stored in the storage unit 109 with an elapse of time. For example, in the segments of FIG. 28B, shift to an adjacent segment result from a certain segment result is possibly caused by the slight fluctuation of the constitution of the movable member or the detection system. Even when the result can be tolerated, but when there is a given or more fluctuation, or different results are obtained every measurement, it can be judged that there is a problem. Also in the reference position, only when there is not any fluctuation after obtaining the reference position, the position is satisfactory. In this case, for example, it is possible to obtain the reference position at the rise of the system and to reselect the optimal synchronous position every time, and self adjustment is possible with respect to a moderate fluctuation with the elapse of time.

TWELFTH EMBODIMENT

[0387] [Constitution]

[0388] Next, a twelfth embodiment of the present invention will be described. In the same manner as in the eighth embodiment, the major constitution of the encoder according to the present embodiment except the signal processing circuit section 6 is not especially limited as long as the position signal and the signal for detecting the reference position are obtained. For example, the general constitution may be used such as the optical encoder constitution shown as the constitution of the major part of the above-described first embodiment in FIG. 1. In the example of FIG. 1, the optical encoder has been described, but another type of the encoder or the displacement sensor such as a magnetic/electrostatic type may also be used as long as the position signal and reference position signal are obtained in accordance with the displacement amount.

[0389] Moreover, the signal processing circuit section 6 in the twelfth embodiment is constituted as shown in FIG. 29. That is, the signal processing circuit section 6 according to the twelfth embodiment includes: the binarizing circuit 101 for converting the analog position signals (a) and (b) to the digital position signals (c) and (d); the binarizing circuit 102 for binarizing the signal for detecting the reference position (e) at the predetermined slice level to convert the signal to the digital signal for detecting the reference position (f); the latch circuit 106 for latching the digital signal for detecting the reference position (f) from the binarizing circuit 102; the synchronous circuit 103 for synchronizing the digital signal for detecting the reference position (f) from the latch circuit 106 with the digital position signals (c) and (d) from the binarizing circuit 101 to generate the reference position signal (g) or (h); the switch 104 for switching the timing of the synchronization in the synchronous circuit 103; the judgment circuit 107 for detecting the optimal synchronous position and judging the stability of the existing synchronous position; and the display 108 for displaying the optimal synchronous position judgment result by this judgment circuit 107.

[0390] Furthermore, in the present embodiment, the reference signal (j) is further given. The reference signal (j) is a reference signal which indicates the amplitude center level of the position signals (a) and (b), and is used in the binarizing circuit 101 and judgment circuit 107. For example, when the position signals (a) and (b) are designed so as to change in a range of −5 V to 5 V, the reference signal (j) indicates 0 V. When the position signals (a) and (b) are designed so as to change in a range of 0 V to 5 V, the reference signal indicates 2.5 V.

[0391] It is to be noted that in the judgment circuit 107, the reference signal (j) is not necessarily required depending on a processing content. The binarizing circuit 101 does not have to necessarily obtain the binarized signal, and may also obtain a digitized signal of a plurality of bits. With the signal of the bits, only the uppermost code bit is extracted in order to extract the binarized data, and then the equal processing is subsequently possible.

[0392] Here, reference position generating position candidates and the division of Lissajous figure of the analog position signals (a) and (b) will be described with reference to FIGS. 30 to 32. It is to be noted that FIGS. 30 to 32 show separate constitutions, and can both correspond to the circuit constitution shown in FIG. 29, and both are shown side by side.

[0393] In FIG. 30, the phases of the reference position signal generating position candidates can be the two intersections of the vertical axis and Lissajous circle, and there is a phase difference of 180° with respect to the period of the position signals (a) and (b). Here, one on the minus side of the vertical axis is assumed to be the synchronous position 1, and the other on the plus side of the vertical axis is the synchronous position 2. Two segments are obtained by dividing the Lissajous circle by the horizontal axis for judging the optimal synchronous position: the one on the plus side of the vertical axis is a segment (O1), and the other on the minus side of the vertical axis is a segment (O2). Furthermore, there are four segments divided by the vertical and horizontal axes for the phase stability judgment of the presently designated reference position candidate, and numbers (S1) to (S4) are attached counterclockwise from the first quadrant.

[0394] Moreover, in FIG. 31, the phases of the reference position signal generating position candidates can be the two intersections of the vertical axis and Lissajous circle, and there is a phase difference of 180° as seen from the position signals (a) and (b) which are references. Here, one on the minus side of the vertical axis is assumed to be the synchronous position 1, and the other on the plus side of the vertical axis is the synchronous position 2. There are four segments divided by the vertical and horizontal axes, and numbers (1) to (4) are attached counterclockwise from the first quadrant as shown in FIG. 31.

[0395] Furthermore, in FIG. 32, the phases of the reference position signal generating position candidates can be the four intersections of two axes including the vertical and horizontal axes with the Lissajous circle, and the phases are arranged at an interval of the phase difference of 90° as seen from the position signals (a) and (b) which are references. Here, one on the minus side of the vertical axis is assumed to be the synchronous position 1, one on the plus side of the vertical axis is the synchronous position 2, one on the minus side of the horizontal axis is the synchronous position 3, and one on the plus side of the horizontal axis is the synchronous position 4. There are four segments obtained by dividing the Lissajous circle by two straight lines represented in the following two equations, and numbers (O1) to (O4) are attached counterclockwise starting from the plus side of horizontal axis as shown in FIG. 32. Additionally, in the following two equations, Va denotes the output of the position signal (a), Vb denotes the output of the position signal (b), and Vref denotes the value of the reference signal (j).

Va=Vb   (Equation 3)

Va+Vb=2Vref   (Equation 4)

[0396] Moreover, there are eight segments obtained by dividing the Lissajous circle by four straight lines in total including two straight lines represented in Equations 3 and 4, the vertical axis, and the horizontal axis for the phase stability judgment of the presently designated reference position candidate, and numbers (S1) to (S8) are attached starting from the segment in the first quadrant and in the vicinity of plus side of the horizontal axis as shown in FIG. 32.

[0397] A plurality of synchronous position candidates in the above-described example of FIGS. 30 to 32 are set so that one or more phases of the reference position signal generating position candidates are included in any segment, when Lissajous waveform of two periodical signals with a phase difference of 90° is divided into two segments by any straight line passing through the amplitude center. In a setting as the one described here, for any position where the signal for detecting the reference position is generated, there will be necessarily a synchronous position candidate having a phase allowance of ±90° or more from the position.

[0398] Moreover, it is assumed that the synchronous circuit 103 in the signal processing circuit section 6 includes the constitution shown in FIGS. 33 to 38. It is to be noted that here FIGS. 34 to 38 show five concrete examples of a detection circuit 103 m for generating the reference position signal synchronized with the position signal as shown in FIG. 33. For two circuits including the detection circuit of the signal for detecting the reference position and a direction distinction circuit in these concrete examples, the flip flop such as LS423 of the D-C trigger type is used.

[0399] In the concrete example shown in FIG. 34, a flip flop 103 m 1 constituting a circuit for detecting the signal for detecting the reference position which outputs the value of the latched signal for detecting the reference position (f); a flip flop 103 m 2 constituting a direction distinction circuit for detecting displacement counterclockwise on the Lissajous circle; and an AND circuit 103 m 3 for obtaining the logical product of the outputs constitute the detection circuit 103 m for detecting that the latched signal for detecting the reference position (f) reaches the high level and is in the set synchronous position. That is, the signal for detecting the reference position (f) latched by the latch circuit 106 is inputted into the data D of the flip flop 103 m 1, the position signal (c) is inputted into the clock CLK, and the output Q is inputted into the AND circuit 103 m 3. The position signal (d) is inputted into the data D of the flip flop 103 m 2, the position signal (c) is inputted into the clock CLK, and the output {overscore (Q)} is inputted into the AND circuit 103 m 3.

[0400] Moreover, in the concrete example shown in FIG. 35, the flip flop 103 m 1 and NOT circuit 103 m 4 constituting the circuit for detecting the signal for detecting the reference position, which outputs the value of the latched signal for detecting the reference position (f) at the fall of the position signal (c); the flip flop 103 m 2 constituting the direction distinction circuit for detecting the displacement clockwise on the Lissajous circle; and the AND circuit 103 m 3 for obtaining the logical product of the outputs constitute the detection circuit 103 m for detecting that the latched signal for detecting the reference position (f) reaches the high level and is in the set synchronous position. That is, the signal for detecting the reference position (f) latched by the latch circuit 106 is inputted into the data D of the flip flop 103 m 1, the position signal (c) reversed by the NOT circuit 103 m 4 is inputted into the clock CLK, and the output Q is inputted into the AND circuit 103 m 3. The position signal (d) is inputted into the data D of the flip flop 103 m 2, the position signal (c) is inputted into the clock CLK, and the output Q is inputted into the AND circuit 103 m 3.

[0401] In the concrete example shown in FIG. 36, the logical sum of the outputs of FIGS. 34 and 35 is obtained by an OR circuit. That is, the signal for detecting the reference position (f) latched by the latch circuit 106 is inputted into the data D of a flip flop 103 m 1 a, the position signal (c) is inputted into the clock CLK, and the output Q is inputted into an AND circuit 103 m 3 a. The position signal (d) is inputted into the data D of a flip flop 103 m 2 a, and the output {overscore (Q)} is inputted into the AND circuit 103 m 3 a. Furthermore, the signal for detecting the reference position (f) latched by the latch circuit 106 is inputted into the data D of a flip flop 103 m 1 b, the position signal (c) reversed by a NOT circuit 103 m 4 b is inputted into the clock CLK, and the output Q is inputted into an AND circuit 103 m 3 b. The position signal (d) is inputted into the data D of a flip flop 103 m 2 b, the position signal (c) is inputted into the clock CLK, and the output Q is inputted into an AND circuit 103 m 3 b. Subsequently, the outputs of the AND circuits 103 m 3 a and 103 m 3 b are inputted into an OR circuit 103 m 5. It is to be noted that two flip flops for the direction distinction (103 m 2 a, 103 m 2 b) are used, but are the same except the way for taking the output, and it is therefore possible to dispose on flip flop and divide the output.

[0402] In the concrete example shown in FIG. 37, the flip flop 103 m 1 and NOT circuit 103 m 4 constituting the circuit for detecting the signal for detecting the reference position, which outputs the value of the latched signal for detecting the reference position (f) at the fall of the position signal (c); the flip flop 103 m 2 constituting the direction distinction circuit for detecting the displacement counterclockwise on the Lissajous circle; and the AND circuit 103 m 3 for obtaining the logical product of the outputs constitute the detection circuit 103 m for detecting that the latched signal for detecting the reference position (f) reaches the high level and is in the set synchronous position. That is, the signal for detecting the reference position (f) latched by the latch circuit 106 is inputted into the data D of the flip flop 103 m 1, the position signal (c) reversed by the NOT circuit 103 m 4 is inputted into the clock CLK, and the output Q is inputted into the AND circuit 103 m 3. The position signal (d) is inputted into the data D of the flip flop 103 m 2, the position signal (c) is inputted into the clock CLK, and the output {overscore (Q)} is inputted into the AND circuit 103 m 3.

[0403] Moreover, in the concrete example shown in FIG. 38, the constitution of FIG. 34, an AND circuit 103 m 6 for setting an output for defining the width of the reference position signal of FIG. 34 to the high level when the position signal (c) indicates the high level and the position signal (d) indicates the low level, and an AND circuit 103 m 7 for obtaining the logical sum of the outputs of the AND circuit 103 m 6 and FIG. 34 constitute the detection circuit 103 m for detecting that the latched signal for detecting the reference position (f) reaches the high level and is subsequently in the set synchronous position. That is, the position signal (c) and the position signal (d) reversed by a NOT circuit 103 m 8 are inputted into the AND circuit 103 m 6, and the outputs of the AND circuit 103 m 6 and AND circuit 103 m 3 in the constitution of FIG. 34 are inputted into an AND circuit 103 m 7.

[0404] Furthermore, it is assumed that the judgment circuit 107 includes three examples shown in FIGS. 39 to 41. Here, FIGS. 39 to 41 correspond to FIGS. 30 to 32.

[0405] In a concrete example shown in FIG. 39, the judgment circuit 107 includes the latch circuit 107 m for latching the position signal (d) and a signal obtained by reversing the position signal (d) in a NOT circuit 107D at the rise of the signal for detecting the reference position (f). The signal of judgment O1 outputted from this latch circuit 107 m indicates the high level, when the position signal (d) indicates the high level. The signal of judgment O2 indicates the high level, when the position signal (d) indicates the low level. Furthermore, the judgment circuit 107 includes: four AND circuits 107F, 107G, 107H, 107I in which the position signal (c), the signal obtained by reversing the signal in a NOT circuit 107E, the position signal (d), and a signal obtained by reversing the signal in the NOT circuit 107D are inputted as shown; and a stability judging section 107J in which the output from the latch circuit 107 m for latching four outputs from the AND circuits 107F to 107I at the rise of the signal for detecting the reference position (f) and designation situation of the existing reference position are inputted. That is, a signal of judgment S1 outputted from the latch circuit 107 m reaches the high level, when both the position signals (c) and (d) indicate the high level. The signal of judgment S2 indicates the high level, when the position signal (c) indicates the high level and the position signal (d) indicates the low level. The signal of judgment S3 indicates the high level, when the position signal (c) indicates the low level and the position signal (d) indicates the high level. The signal of judgment S4 indicates the high level, when both the position signals (c) and (d) indicate the low level.

[0406] Moreover, in a concrete example shown in FIG. 40, the judgment circuit 107 includes: four AND circuits 107F, 107G, 107H, 107I in which the position signal (c), the signal obtained by reversing the position signal in the NOT circuit 107E, the position signal (d), and the signal obtained by reversing the position signal in the NOT circuit 107D are inputted as shown; the latch circuit 107 m for latching four outputs from these AND circuits 107F to 107I at the rise of the signal for detecting the reference position (f); and the stability judging section 107J in which the output of the latch circuit 107 m and the designation situation of the existing reference position are inputted. The signal of judgment 1 outputted from the latch circuit 107 m indicates the high level, when both the position signals (c) and (d) indicate the high level. The signal of judgment 2 indicates the high level, when the position signal (c) indicates the high level and the position signal (d) indicates the low level. The signal of judgment 3 indicates the high level, when the position signal (c) indicates the low level and the position signal (d) indicates the high level. The signal of judgment 4 indicates the high level, when both the position signals (c) and (d) indicate the low level.

[0407] Moreover, a concrete example shown in FIG. 41 is constituted of: the comparator 107 h for comparing the value of the position signal (a) with that of the position signal (b); the reverse circuit 107 g constituted of two resistances having the equal resistance value for generating a signal ({overscore (b)}) linearly symmetric with respect to the reference signal (j) which is the reference from the position signal (b) and the operating amplifier; the comparator 107 i for comparing the value of the signal ({overscore (b)}) with that of the position signal (a); four AND circuits 107 n, 107 o, 107 q, 107 s in which the outputs of the comparators 107 h and 107 i, and the signals obtained by reversing the outputs by NOT circuits 107 p, 107 r are inputted as shown: eight AND circuits 107 t, 107 u, 107 v, 107 w, 107 x, 107 z, 107B, 107C in which output signals (p) to (s) of these four AND circuits, the position signal (c), the signal obtained by reversing the position signal by a NOT circuit 107A, the position signal (d), and a signal obtained by reversing the position signal in a NOT circuit 107 y are inputted as shown; the latch circuit 107 m for latching the signals (p) to (s) and eight outputs from the eight AND circuits at the rise of the signal for detecting the reference position (f); and the stability judging section 107J in which the signals (S1) to (S8) and the designation situation of the existing reference position are inputted among the outputs from the latch circuit 107 m including judgments (O1) to (O4) corresponding to the signals (p) to (s) and signals (S1) to (S8) corresponding to eight outputs from eight AND circuits and which outputs the stability judgment result of the existing reference position.

[0408] The designation situation or judgment result of the existing reference position is stored in a storage unit (not shown) in the signal processing circuit section 6, a storage unit (not shown) disposed in the switch 104 or the judgment circuit 107, any of external storage units connected to the outside of the signal processing circuit section 6, or a plurality of storage units among these. This storage unit is mainly constituted of the storage mediums, and also constituted of the logic array or CPU for processing the judgment result or for the input/output if necessary. In the storage unit, the judgment result from the judgment circuit 107 is stored, and the judgment result is outputted to the outside. Moreover, the storage unit is constituted so as to send the judgment result to the switch 104 for switching the synchronous timing and to switch the position to the synchronous position judged as optimal. For the storage unit, the nonvolatile storage mediums are desirable such as SRAM and flash ROM in which the information is maintained even when power is turned off.

[0409] [Operation]

[0410] The processing of the input from the photodetector 5 shown in FIG. 1 by the signal processing circuit section 6 in the present embodiment will be described with reference to the time charts in FIGS. 42 and 43. It is to be noted that FIG. 42 shows the displacement in the counterclockwise direction on the Lissajous circle, and FIG. 43 shows the displacement in the clockwise direction on the Lissajous circle.

[0411] The analog position signals (a) and (b) of the encoder which periodically change with the displacement (relative movement of the scale 4) are digitized in the binarizing circuit 101 to obtain the digital position signals (c) and (d). In the binarizing circuit 102, the signal for detecting the reference position (e) is binarized at the predetermined slice level to obtain the digital signal for detecting the reference position (f). In the latch circuit 106, the rise of the digital signal for detecting the reference position (f) is detected to set the latch signal (i) to the high level.

[0412] Moreover, in a region where the latch signal (i) indicates the latch signal (i), one is selected from the following two detection methods to obtain the reference position signal. It is to be noted that the direction of the reference position detection is detected only when the point determined by (Va, Vb) on the Circumference of the Lissajous circle of FIGS. 30 to 32 is counterclockwise, that is, when the point moves in the reference position detection direction and the direction shown by the arrow.

[0413] In the first method, after the generation of the latch signal (i), the signal is synchronized with the first rise of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (g) is obtained. Here, the level changes of the position signals (a) and (b) which are the analog signals indicate the level change of the reference signal (j) upwards from the lower level or downwards from the upper level. In the second method, after the generation of the latch signal (i), the signal is synchronized with the first fall of the position signal (a) or (c) to obtain the high level, and synchronized with the level change of the position signal (b) or (d) to obtain the low level, so that the reference position signal (h) is obtained. One is selected from these two to output the reference position signal (g) or (h), and the selection is carried out by the switch 104.

[0414] Here, the generation of a rise part of the first reference position signal (g) will be described in detail with reference to FIGS. 33 and 34.

[0415] In the detection circuit 103 m shown in FIG. 33, the position signals (c) and (d) and the latch signal (i) are inputted. After the latched signal for detecting the reference position (f) reaches the high level, the reference position signal is generated in the set synchronous position from the circuit. It is to be noted that the present embodiment is not necessarily limited to this. For example, the function of the direction distinction can be realized based on the input signal, but the direction distinction function is not necessarily included.

[0416]FIG. 34 shows the reference position detection at the time of the displacement in the counterclockwise direction on the Lissajous circle. The direction distinction will first be described. The position signal (d) is inputted into the data D of the flip flop 103 m 2, and the position signal (c) is inputted into the clock CLK. As a result, the signal outputted from the output {overscore (Q)} of the flip flop 103 m 2 is updated as the reversed signal of the position signal (d) at every rise of the position signal (c). Therefore, only when the position signal (d) indicates the low level at the time of the rise of the position signal (c), the output {overscore (Q)} of the flip flop 103 m 2 indicates the high level, and the direction distinction is therefore possible. Moreover, for the detection of the signal for detecting the reference position, the latch signal (i) is inputted into the data D of the flip flop 103 m 1, and the position signal (c) is inputted into the clock CLK. As a result, the signal outputted from the output Q of the flip flop 103 m 1 is updated as the latch signal (i) at every rise of the position signal (c). As a result, it is possible to output the signal for detecting the reference position synchronized at the timing of the rise of the position signal (c) after the signal for detecting the reference position is detected. Moreover, when the AND circuit 103 m 3 obtains the logical product of the direction distinction signal and the synchronized signal for detecting the reference position, it is possible to generate the reference position signal (g) shown in FIG. 42 in the predetermined detection direction and timing.

[0417] On the other hand, with the displacement in the opposite direction, as shown by the signal (g) of FIG. 43, the reference position signal (g) is not detected.

[0418] The generation of the rise part of the second reference position signal (h) will be described with reference to FIG. 37. With respect to FIG. 34, for the detection of the signal for detecting the reference position, the flip flop 103 m 1 detects the rise of the signal obtained by reversing the position signal (c) in the NOT circuit 103 m 4. Since the detection is performed in the same moving direction, it is possible to generate the reference position detection signal (h) shown in FIG. 42 in the synchronous position 2 in FIGS. 31 and 32.

[0419] On the other hand, with the displacement in the opposite direction, as shown in FIG. 43, the reference position signal (h) is not detected.

[0420] It is to be noted that the change of the moving direction at the reference position detection time, or the detection in the opposite directions will be described with reference to FIGS. 35 and 36.

[0421]FIG. 35 shows the reference position detection at the time of the displacement in the clockwise direction on the Lissajous circle in reverse to FIG. 34. For the direction distinction, the same flip flop 103 m 2 as that of the concrete example of FIG. 34 is used. However, when the output Q is taken as the output, the detection of the opposite direction is possible. For the detection of the signal for detecting the reference position, the position signal (c) in the synchronous position 1 in FIGS. 31 and 32 falls with the displacement of the opposite direction. Therefore, the rise of the signal obtained by reversing the position signal (c) in the NOT circuit 103 m 4 is detected. When these are combined, it is possible to detect the reference position of the opposite direction in the same synchronous position 1 as that of FIG. 34 as shown by a reference position signal (g′) of FIG. 43. It is to be noted that with the displacement in the counterclockwise direction on the Lissajous circle, the reference position is not detected from the result of the direction detection as shown by the reference position signal (g′) of FIG. 42.

[0422] In the concrete example of FIG. 36, the logical sum of the outputs of the concrete examples of FIGS. 34 and 35 is taken in the OR circuit 103 m 5, and this is effective when the reference position is detected in both the forward and backward directions. As a result, it is possible to detect the reference position signals shown in (g) of FIG. 42 and (g′) of FIG. 43.

[0423] Furthermore, the conditions for emitting the reference position signal which has a predetermined signal width are added. In the present embodiment, the rise of the position signal (c) to the rise of the position signal (d) are detected. The rise edge of the position signal (c) is the important point. On the other hand, the detection width may be designated by a predetermined time or by the displacement amount of the measurement object, and the width itself may also arbitrarily be designated. For example, a minimum detection width of the encoder may be set. In the present concrete example, when the direction is designated, the condition including the rise of the position signal (c) till the rise of the position signal (d) in accordance with the displacement amount is disposed. This is equivalent to the case where the position signal (c) has the high level and the position signal (d) has the low level. This condition is added.

[0424] In the concrete example of FIG. 38, in order to obtain the reference position signal which has the predetermined width, the logical product of the signal reaching the high level when the position signal (c) indicates the high level and the position signal (d) indicates the low level, and the reference position signal of FIG. 34 is taken by the AND circuit 103 m 7. Accordingly, it is possible to generate the reference position signal (g) only for a ¼ period. Furthermore, in the circuit constitution of FIG. 38, there is a possibility that a plurality of reference position signals are generated. After detecting the reference position signal, by the reset signal (not shown) in the circuit, the flip flop 103 m 1 which functions as the latch circuit of the rise edge of the reference position detection signal (f) and a synchronous detection circuit with the position signal (c) is reset, and the output Q thus needs to be returned to the low level.

[0425] It is to be noted that in FIGS. 34 to 38, when the movable member moving in a predetermined reference position detection direction is reversed, this is detected by the direction distinction circuit, and the reference position signal is not outputted. Additionally, in the example of FIG. 36, since the detection in the opposite directions is possible, the reference position detection in the opposite direction is possible.

[0426] After the signal for detecting the reference position is generated and latched, the direction is reversed. In this case, there is possibility that wrong detection is performed in the reference position detection. When the movable member does not move in the predetermined direction, the latched signal for detecting the reference position is reset, and this wrong detection can be prevented.

[0427] The concrete example will be described with reference to FIG. 34. When the movable member moves in a direction different from the direction of the reference position detection, a signal {overscore (Q)} of the flip flop 103 m 2 for distinguishing the direction indicates the low level and the signal Q reaches the high level. The signal Q or {overscore (Q)} of the flip flop 103 m 2 for distinguishing the direction is reversed if necessary, and accordingly the signal is connected to a reset terminal (not shown) of the flip flop 103 m 1 for detecting the signal for detecting the reference position. Accordingly, when the movable member moves in the direction different from the direction of the reference position detection, the signal Q of the flip flop 103 m 1 for detecting the signal for detecting the reference position is reset to temporarily stop a sequence of reference position detection. Similar handling is possible also in another example.

[0428] When the synchronous circuit 103 shown in FIGS. 33 to 38 described above is appropriately designed, the reference position can be detected with a predetermined detection width in a desires synchronous position in the displacement of both the forward and backward directions.

[0429] It is to be noted that the position signals (a) and (c) have the phase difference of 90° from the position signals (b) and (d). The position detection signals (a) and (b) and the signal for detecting the reference position (e) which are the analog signals may be signals of any type as long as the position detection signals (c) and (d) and the signal for detecting the reference position (f) which are the digital signals can be created. Furthermore, the inputs from the detection system may be only the digital signals, and may not include any analog signal. When the position detection signal is digitized, the resolution may be enhanced by the phase interpolation.

[0430] Moreover, the position detection is carried out by inputting the digital position detection signals (c) and (d) into the counter. In this case, when the reference position signal (g) or (h) is generated, the counter is reset, or an appropriate preset value is set, and it is possible to obtain the reference position of the position detection.

[0431] As described above, in the present embodiment, after detecting the signal for detecting the reference position, the reference position signal is outputted in accordance with the first synchronous position. Therefore, all the synchronous positions are disposed within one period of the periodical signal.

[0432] Moreover, depending on the method for detecting the reference position, it is possible to store the periodical signal for detecting the position in the vicinity of the reference position and the signal for detecting the reference position and to distinguish the synchronous position closest to the generating position of the signal for detecting the reference position as the reference position. In this case, when the displacement amount using the distinguished position as the reference is sent as the preset value to the controller or counter, the reference position can exactly be obtained. In this example, when a plurality of reference position candidates are disposed, all the detection position candidates are arranged for one period before/after the generation time of the signal for detecting the reference position.

[0433] Next, outlines of the candidates of the synchronous position and the detection of the optimal synchronous position will be described with reference to FIGS. 30 to 32. Depending on the segment where the point determined by the position signals (a) and (b) exists at the rise, indicating the detection, of the signal for detecting the reference position (f), the optimal synchronous position candidate is determined. Basically, for a plurality of segments and a plurality of synchronous position candidates, phase allowances with all the synchronous position candidates are determined in the stepwise manner for each segment, and the synchronous position candidate having the largest phase allowance is regarded as optimal and outputted. In the present embodiment, assuming that the number of segments is two, the number of synchronous position candidates is two, and the phase difference is 0° to 180°, the phase allowance is optimal when the phase difference is largest. With respect to the phase allowance, as seen in a case where the processing is not performed in real time, when the phase difference is represented from 0° to 180°, conversely the candidate in the vicinity of 0° may be regarded as optimal.

[0434] The case of FIG. 30 will be described. The synchronous position candidates include the synchronous positions 1 and 2 apart from each other by a phase of 180°. A segment where the point determined by the position signals (a) and (b) is included at the rise of the signal for detecting the reference position (f) is (O1). In this case, there is a phase difference of 90° or more with respect to the synchronous position 1, but there is only a phase difference within 90° with respect to the synchronous position 2. Therefore, since the phase difference is larger with respect to the synchronous position 1 rather than the synchronous position 2, the synchronous position 1 is detected as the optimal synchronous position, and obtained as the judgment result. Similarly, the segment where the point determined by the position signals (a) and (b) is included at the rise of the signal for detecting the reference position (f) is (O2). In this case, the phase difference is larger with respect to the synchronous position 2 rather than the synchronous position 1. Therefore, the synchronous position 1 is detected as the optimal synchronous position, and obtained as the judgment result.

[0435] Next, the case of FIG. 31 will be described. The synchronous position candidates include the synchronous positions 1 and 2 apart from each other by the phase of 180°. The segment where the point determined by the position signals (a) and (b) is included at the rise of the signal for detecting the reference position (f) is (1) or (2). In this case, there is a phase difference of 90° or more with respect to the synchronous position 1, but there is only a phase difference within 90° with respect to the synchronous position 2. Therefore, since the phase difference is larger with respect to the synchronous position 1 rather than the synchronous position 2, the synchronous position 1 is detected as the optimal synchronous position, and obtained as the judgment result. Similarly, the segment where the point determined by the position signals (a) and (b) is included at the rise of the signal for detecting the reference position (f) is (3) or (4). In this case, the phase difference is larger with respect to the synchronous position 2 rather than the synchronous position 1. Therefore, the synchronous position 1 is detected as the optimal synchronous position, and obtained as the judgment result.

[0436] Furthermore, the case of FIG. 32 will be described. The synchronous position candidates include four synchronous positions 1 to 4 disposed every phase of 90°. The synchronous positions 1 and 2 are disposed apart from each other by the phase of 180° on the vertical axis, and the synchronous positions 3 and 4 are disposed apart from each other by the phase of 180° on the horizontal axis. The segment where the point determined by the position signals (a) and (b) is included at the rise of the signal for detecting the reference position (f) is (O1). In this case, there is a phase difference of 135° or more and 180° or less with respect to the synchronous position 3, but there is only a phase difference of 45° or more and 135° or less with respect to the synchronous positions 1 and 2, and there is only a phase difference of 0° or more and 45° or less with respect to the synchronous position 4. Therefore, since the phase difference is largest with respect to the synchronous position 3 rather than the synchronous positions 1, 2, and 4, the synchronous position 3 is detected as the optimal synchronous position, and obtained as the judgment result. Similarly, the segment where the point determined by the position signals (a) and (b) is included at the rise of the signal for detecting the reference position (f) is (O2). In this case, the synchronous position 1 is detected as the optimal synchronous position and obtained as the judgment result. The synchronous position 4 with (O3), and the synchronous position 2 with (O4) are detected as the optimal synchronous positions, and obtained as the judgment results, respectively.

[0437] Next, concerning the segment for use in judging the optimal synchronous position candidate, the detection of the segment where the point determined by the position signals (a) and (b) is included at the detection time of the signal for detecting the reference position (f) will be described with reference to FIGS. 39 to 41.

[0438] In the concrete example shown in FIG. 40, the segment is divided by the following two judgments.

Va>Vref   (Equation 5)

Vb>Vref   (Equation 6)

[0439] Here, there are four ways of dividing the segment: segment (1) is obtained when Equations 5 and 6 are both true; segment (2) is obtained when Equation 5 is false and Equation 6 is true; segment (3) is obtained when both the equations are false; and segment (4) is obtained when Equation 5 is true and Equation 6 is false. In the actual circuit example shown in FIG. 40, four segment judgment signals generated using the binarized position signals (c) and (d), two NOT circuits 107D, 107E, and four AND circuits 107F to 107I are latched by the latch circuit 107 m at the timing of the detection of the signal for detecting the reference position. The segment where the position signals (a) and (b) exist is judged by the signal reaching the high level among the four signals. Therefore, the judgment 1 corresponds to the segment (1), the judgment 2 corresponds to the segment (4), the judgment 3 corresponds to the segment (2), and the judgment 4 corresponds to the segment (3).

[0440] Moreover, in the concrete example shown in FIG. 39, the segmenting is performed by the judgment of (Equation 6). There are two ways of choosing the segment: the segment (O1) is obtained when Equation 6 is true; and the segment (O2) is obtained when Equation 6 is false. In the actual circuit example shown in FIG. 39, two segment judgment signals generated using the binarized position signal (d) and the NOT circuit 107D are latched by the latch circuit 107 m at the timing of the detection of the signal for detecting the reference position. The segment where the position signals (a) and (b) exist is judged by the signal reaching the high level among the two signals. Therefore, the judgment O1 corresponds to the segment (O1), and the judgment O2 corresponds to the segment (O2).

[0441] In the concrete example shown in FIG. 41, the segmenting is performed by the following two judgments.

Va>Vb   (Equation 7)

Va+Vb>2Vref   (Equation 8)

[0442] Here, there are four ways of dividing the segment: segment (O1) is obtained when Equations 7 and 8 are both true; segment (O2) is obtained when Equation 7 is false and Equation 8 is true; segment (O3) is obtained when both are false; and segment (O4) is obtained when Equation 7 is true and Equation 8 is false. In the actual circuit shown in FIG. 41, four segment judgment signals (p) to (q) generated using the analog position signals (a) and (b), one operating amplifier, two comparators 107 h, 107 i, two resistances, two NOT circuits 107 p, 107 r, and four AND circuits 107 n, 107 o, 107 q, 107 s are latched by the latch circuit 107 m at the timing of the detection of the signal for detecting the reference position. The segment where the position signals (a) and (b) exist is judged by the signal reaching the high level among the four signals (p) to (s). Therefore, the judgment O1 corresponds to the segment (O1), the judgment O2 corresponds to the segment (O2), the judgment O3 corresponds to the segment (O3), and the judgment O4 corresponds to the segment (O4).

[0443] It is to be noted that in the present embodiment, Va and Vb denote the signals which has the common amplitude center and amplitude. However, when there is a difference in the actual signal, the signal is normalized and applied so that the signal has the common amplitude center and amplitude. When Va is different from Vb only in an amplitude center value, instead of using the same reference signal Vref, the center values are individually set with respect to Va and Vb, and the values are applied to Equations 5, 6, 7, and 8 so as to apply to the segmenting of FIG. 31 or 32.

[0444] Next, judgment logic and details of the concrete circuit in the detection of the optimal synchronous position candidate will be described with reference to FIGS. 39 to 41.

[0445] In the concrete example of FIGS. 39 and 40, the synchronous position 1 is set to a center phase of a region where the position signal (d) as the binarized signal of Vb indicates the low level, and the synchronous position 2 is set to the center phase of the region where the position signal (d) indicates the high level. The synchronous position where the phase difference from the point in which the position signals (a) and (b) exist is largest at the detection time of the signal for detecting the reference position (f) is judged as optimal. The synchronous position included in a region having a level different from that of the position signal (d) at the detection time of the signal for detecting the reference position (f) is optimal.

[0446] In the concrete example of FIG. 39, the segment (O2) is included in the region where the position signal (d) indicates the low level, and the segment (O1) is included in the region where the position signal (d) indicates the high level. Therefore, when the result of the judgment O1 is obtained, the synchronous position 1 is the optimal synchronous position. Furthermore, in the judgment O1, it is seen that there is a phase allowance of 90° or more both in the clockwise and counterclockwise directions from the position at the reference position signal detection time to the synchronous position 1. Similarly, when the result of the judgment O2 is obtained, the synchronous position 2 is the optimal synchronous position. In the judgment O2, it is seen that there is a phase allowance of 90° or more both in the clockwise and counterclockwise directions from the position at the reference position signal detection time to the synchronous position 2. The above-described processing is realized in the circuit of FIG. 39.

[0447] In the concrete example of FIG. 40, the synchronous position 1 is set to the center phase of the region where the position signal (d) as the binarized signal of Vb indicates the low level, and the synchronous position 2 is set to the center phase of the region where the position signal (d) indicates the high level. The synchronous position where the phase difference from the point in which the position signals (a) and (b) exist is largest at the detection time of the signal for detecting the reference position (f) is judged as optimal. Therefore, the synchronous position included in the region having the level different from that of the position signal (d) at the detection time of the signal for detecting the reference position (f) is optimal.

[0448] The segments (3) and (4) are included in the region where the position signal (d) indicates the low level, and the segments (1) and (2) are included in the region where the position signal (d) indicates the high level. Therefore, two segments made by putting together the segments (1) and (2) of the actual four segments into one and the segments (3) and (4) into one at the same time, are efficient for the judgment of the optimal synchronous position. By finer segmenting, the phase allowance can be confirmed for each moving direction.

[0449] Therefore, when the result of the judgment 1 or 3 is obtained, the synchronous position 1 is the optimal synchronous position. Furthermore, in the judgment 1, it is seen that there is a phase allowance of 90° or more in the clockwise direction from the position at the reference position signal detection time to the synchronous position 1, and there is a phase allowance of 180° or more in the counterclockwise direction. It is seen in the judgment 3 that there is a phase allowance of 180° or more in the clockwise direction and there is a phase allowance of 90° or more in the counterclockwise direction. Similarly, when the result of the judgment 2 or 4 is obtained, the synchronous position 2 is the optimal synchronous position. Furthermore, in the judgment 2, it is seen that there is a phase allowance of 180° or more in the clockwise direction from the position at the reference position signal detection time to the synchronous position 2, and a phase allowance of 90° or more in the counterclockwise direction. It is seen in the judgment 4 that there is a phase allowance of 90° or more in the clockwise direction and there is a phase allowance of 180° or more in the counterclockwise direction.

[0450] The above-described processing is realized in the circuit of FIG. 40.

[0451] In the concrete example of FIG. 41, the synchronous position 1 is set to the center phase of the segment O4 as a region where Equation 7 is true and Equation 8 is false, and the synchronous position 2 is set to the center phase of the segment O2 as a region where Equation 7 is false and Equation 8 is true. The synchronous position 3 is set to the center phase of the segment O3 as a region where Equations 7 and 8 are both false, and the synchronous position 4 is set to the center phase of the segment O1 as a region where Equations 7 and 8 are both true. The synchronous position having the largest phase difference from the point where the position signals (a) and (b) exist at the detection time of the signal for detecting the reference position (f) is judged as optimal. Therefore, the synchronous position whose phase is most distant from the segment at the detection time of the signal for detecting the reference position (f), that is, which is included in the segment on the opposite side is optimal.

[0452] Therefore, when the result of the judgment O1 is obtained, the synchronous position 3 is the optimal synchronous position, and there is a phase allowance of 90° or more both in the clockwise and counterclockwise directions from the position at the reference position signal detection time to the synchronous position 3. When the result of the judgment O2 is obtained, the synchronous position 1 is the optimal synchronous position, and there is a phase allowance of 90° or more both in the clockwise and counterclockwise directions from the position at the reference position signal detection time to the synchronous position 1. When the result of the judgment O3 is obtained, the synchronous position 4 is the optimal synchronous position, and there is a phase allowance of 90° or more both in the clockwise and counterclockwise directions from the position at the reference position signal detection time to the synchronous position 4. When the result of the judgment O4 is obtained, the synchronous position 2 is the optimal synchronous position, and there is a phase allowance of 90° or more both in the clockwise and counterclockwise directions from the position at the reference position signal detection time to the synchronous position 2.

[0453] The above-described processing is realized in the circuit of FIG. 41.

[0454] It is to be noted that concerning the judgment result of the optimal synchronous position candidate, the signals with the outputs of judgments 1 to 4 and the judgments O1 to O4 are outputted in parallel in the present embodiment, but an encoded judgment result may also be outputted.

[0455] Next, the outlines of the method for judging the stability of the presently set synchronous position will be described with reference to FIGS. 30 to 32.

[0456] That is, in the present embodiment, at the rise, indicating the detection, of the signal for detecting the reference position (f), the synchronous position stability is judged by judging the segment where the point determined by the position signals (a) and (b) exists. For the way of judgment, in the same manner as in the detection of the optimal synchronous position, the larger the phase difference between the segment included at the rise of the signal for detecting the reference position (f) and the synchronous position is, the higher the stability is. The smaller the phase difference is, the lower the stability is.

[0457] First, the case of FIG. 30 will be described. The case where the synchronous position is set to the synchronous position 1 will be described. The segment where the point determined by the position signals (a) and (b) is included at the rise of the signal for detecting the reference position (f) is (S1). In this case, there is a phase allowance of 90° clockwise and 180° counterclockwise. When the segment is (S2), there is a phase allowance of 180° clockwise and 90° counterclockwise. When the segment is (S3), there is a phase allowance of 270° clockwise, and there is not any phase allowance counterclockwise. When the segment is (S4), there is not any phase allowance clockwise, and there is a phase allowance of 270° counterclockwise. From the above, there are two levels in the stability, with respect to the synchronous position 1, the segments (S1) and (S2) have high stability, and the segments (S3) and (S4) have low stability. Similarly, with respect to the synchronous position 2, the segments (S3) and (S4) have the high stability, and the segments (S1) and (S2) have the low stability.

[0458] Additionally, a judgment standard that a large absolute value of the phase difference is consistently stable is used. When there is a peculiar condition, for example, when the change of the phase difference occurs in one direction, the judgment standard of the phase allowance stability needs to be used in accordance with the conditions.

[0459] Moreover, in the case of FIG. 31, for the description of FIG. 30, the segments (S1) to (S4) may be replaced with the segments (1) to (4).

[0460] Next, the case of FIG. 32 will be described. The case where the synchronous position is set to the synchronous position 1 will be described. The segment where the point determined by the position signals (a) and (b) is included at the rise of the signal for detecting the reference position (f) is (S1). In this case, there is a phase allowance of 90° clockwise and 225° counterclockwise. When the segment is (S2), there is a phase allowance of 180° clockwise and 135° counterclockwise. When the segment is (S3), there is a phase allowance of 180° clockwise, and 135° counterclockwise. When the segment is (S4), there is a phase allowance of 225° clockwise, and 90° counterclockwise. When the segment is (S5), there is a phase allowance of 270° clockwise and 45° counterclockwise. When the segment is (S6), there is a phase allowance of 315° clockwise and there is not any phase allowance counterclockwise. When the segment is (S7), there is not any phase allowance clockwise, and there is a phase allowance of 315° counterclockwise. When the segment is (S8), there is a phase allowance of 45° clockwise and 270° counterclockwise. From the above, there are four levels in the stability, with respect to the synchronous position 1, the segments (S2) and (S3) have highest stability, the segments (S1) and (S4) have secondly high stability, the segments (S5) and (S8) have thirdly high stability, and the segments (S6) and (S6) have a lowest stability.

[0461] Similarly, with respect to the synchronous position 2, the segments (S6) and (S7) are highest in the stability, the segments (S5) and (S8) are secondly high in the stability, the segments (S1) and (S4) are thirdly high in the stability, and the segments (S2) and (S3) are lowest in the stability. With respect to the synchronous position 3, the segments (S1) and (S8) are highest in the stability, the segments (S2) and (S7) are secondly high in the stability, the segments (S3) and (S6) are thirdly high in the stability, and the segments (S4) and (S5) are lowest in the stability. Moreover, with respect to the synchronous position 4, the segments (S4) and (S5) are highest in the stability, the segments (S3) and (S6) are secondly high in the stability, the segments (S2) and (S7) are thirdly high in the stability, and the segments (S1) and (S8) are lowest in the stability.

[0462] It is to be noted that depending on the purpose, it is possible to dispose three levels of the stability as a whole by combining the first and the second stability levels or the second and the third stability levels as one group of stability.

[0463] Next, concerning the segment for use in judging the stability, the detection of the segment where the point determined by the position signals (a) and (b) is included at the detection time of the signal for detecting the reference position (f) will be described. This is basically the same procedure as that in detecting the optimal synchronous position. In the present embodiment the detection will be described with reference to FIGS. 39 to 41.

[0464] In the concrete example of FIGS. 39 and 40, the segmenting is performed by the same method as that in detecting the optimal synchronous position in the constitution shown in FIG. 31. That is, a segment (S1) or (1) is obtained when Equations 5 and 6 are both true. A segment (S2) or (2) is obtained when Equation 5 is false and Equation 6 is true. A segment (S3) or (3) is obtained when both the equations are false. A segment (S4) or (4) is obtained when Equation 5 is true and Equation 6 is false. There are four ways of segmenting. In the actual circuit example, as shown in FIGS. 39 and 40, segment judgment signals are generated using the binarized position signals (c) and (d), two NOT circuits 107D, 107E, and four AND circuits 107F to 107I. The segment where the position signals (a) and (b) exist is judged by the signal reaching the high level at the timing of the detection of the signal for detecting the reference position among four signals to be inputted into the latch circuit 107 m.

[0465] Moreover, in the example of FIG. 41, the segmenting is performed by four judgments of Equations 5, 6, 7, and 8. That is, when Equations 5, 6, 7, and 8 are all true, the segment (S1) is obtained. When Equations 5 and 6 are true, Equation 7 is false, and Equation 8 is true, the segment (S2) is obtained. When Equation 5 is false, Equation 6 is true, Equation 7 is false, and Equation 8 is true, the segment (S3) is obtained. When Equations 5, 6, 7, and 8 are all false, a segment (S5) is obtained. When Equations 5 and 6 are false, Equation 7 is true, and Equation 8 is false, a segment (S6) is obtained. When Equation 5 is true, Equation 6 is false, Equation 7 is true, and Equation 8 is false, a segment (S7) is obtained. When Equation 5 is true, Equation 6 is false, and Equations 7 and 8 are true, a segment (S8) is obtained. There are eight ways of segmenting. In the actual circuit, as shown in FIG. 41, four signals (p) to (q) generated in segmenting the optimal synchronous position, further the binarized position signals (c) and (d), two NOT circuits 10 y, 107A, and eight AND circuits 107 t to 107 x, 107 z, 107B, 107C are used to generate eight segment detecting signals. The signals are latched by the latch circuit 107 m at the timing of the detection of the signal for detecting the reference position, and the segment where the position signals (a) and (b) exist is detected by the signal reaching the high level among the eight signals.

[0466] Next, the judgment logic and the details of the concrete circuit with respect to the stability judgment of the existing synchronous phase will be described with reference to FIGS. 39 to 41.

[0467] In the concrete example of FIGS. 39 and 40, the synchronous position 1 is set to the center phase of the region where the position signal (d) as the binarized signal of Vb indicates the low level, and the synchronous position 2 is set to the center phase of the region where the position signal (d) indicates the high level. When the phase difference between the point in which the position signals (a) and (b) exist and the existing synchronous position at the detection time of the signal for detecting the reference position (f) is large, the system is judged as stable. Therefore, when the synchronous position is included in the region having the level different from that of the position signal (d) at the detection time of the signal for detecting the reference position (f), the system is stable. When the position is included in a region having the same level, the system is unstable. The segment (S3) or (3) and the segment (S4) or (4) are included in a region where the position signal (d) indicates the low level, and the segment (S1) or (1) and the segment (S2) or (2) are included in a region where the position signal (d) indicates the high level. Therefore, the segment is actually divided into four segments, but in the judgment of the stability, the segments (S1) and (S2) or (1) and (2) are united, the segments (S3) and (S4) or (3) and (4) are united, and accordingly the judgment with two segments is efficient. By finer segmenting, the phase allowance can be confirmed for each moving direction.

[0468] First, a case where the synchronous position 1 is the existing synchronous position will be described. When the result of judgment S1 or S3 is obtained, or when the result of the judgment 1 or 3 is obtained, the phase is stable. In the judgment S1 or 1, it is seen that there is a phase allowance of 90° or more in the clockwise direction from the position at the reference position signal detection time to the synchronous position 1, and there is a phase allowance of 180° or more counterclockwise. It is seen in the judgment S3 or 3 that there is a phase allowance of 180° or more in the clockwise direction and there is a phase allowance of 90° or more counterclockwise. When the result of the judgment S2 or S4 is obtained, or when the result of judgment 2 or 4 is obtained, the phase is unstable. In the judgment S2 or 2, it is seen that there is a phase allowance of 90° or less in the clockwise direction from the position at the reference position signal detection time to the synchronous position 1, and a phase allowance of 270° or more counterclockwise. It is seen in the judgment S4 or 4 that there is a phase allowance of 270° or more in the clockwise direction and there is a phase allowance of 90° or less counterclockwise.

[0469] Next, a case where the synchronous position 2 is the existing synchronous position will be described. When the result of the judgment S1 or S3 is obtained, or when the result of judgment 1 or 3 is obtained, the phase is unstable. In the judgment S1 or 1, it is seen that there is a phase allowance of 270° or more in the clockwise direction from the position at the reference position signal detection time to the synchronous position 1, and there is a phase allowance of 90° or less counterclockwise. It is seen in the judgment S3 or 3 that there is a phase allowance of 90° or less in the clockwise direction and there is a phase allowance of 270° or more counterclockwise. When the result of the judgment S2 or S4 is obtained, or when the result of the judgment 2 or 4 is obtained, the phase is stable. In the judgment S2 or 2, it is seen that there is a phase allowance of 180° or more in the clockwise direction from the position at the reference position signal detection time to the synchronous position 1, and a phase allowance of 90° or more counterclockwise. It is seen in the judgment S4 or 4 that there is a phase allowance of 90° or more in the clockwise direction and there is a phase allowance of 180° or more counterclockwise.

[0470] The above-described processing is performed and outputted by the judgment circuit 107 constituted as shown in FIGS. 39 and 40.

[0471] In the concrete example of FIG. 41, the synchronous position 1 is set to the center phase of the segment O4 as a region where Equation 7 is true and Equation 8 is false, and the synchronous position 2 is set to the center phase of the segment O2 as a region where Equation 7 is false and Equation 8 is true. The synchronous position 3 is set to the center phase of the segment O3 as a region where Equations 7 and 8 are both false, and the synchronous position 4 is set to the center phase of the segment O1 as a region where Equations 7 and 8 are both false. The synchronous position having the largest phase difference from the point where the position signals (a) and (b) exist at the detection time of the signal for detecting the reference position (f) is judged as optimal. Therefore, the synchronous position whose phase is most distant from the segment at the detection time of the signal for detecting the reference position (f), that is, which is included in the segment on the opposite side is optimal. As seen from FIG. 41, the segment O1 includes segments S1 and S8, segment O2 includes segments S2 and S3, the segment O3 includes segments S4 and S5, and the segment O4 includes segments S6 and S7.

[0472] For the level segment of the stability of the present concrete example, the level can be divided into four levels at maximum with respect to a specific synchronous position. This is because the number of segments is eight, there are symmetrically four segments each clockwise and counterclockwise as seen from the specific synchronous position, the segments in the symmetric positions are united into one, and the level is divided into four groups. Therefore, the level is divided into four: level 1) the phase allowance from the synchronous position is 135° to 180°; level 2) 90° to 135°; level 3) 45° to 90°; and level 4) 0° to 45°. Furthermore, for these levels, when the adjacent levels are united, two levels or three levels can be obtained. In the following description, the case where the level is divided into four will be described, but in the actual application, the level may also be divided into two or three.

[0473] First, the case where the synchronous position 1 is the existing synchronous position will be described. When the result of the judgment S2 or S3 is obtained, the level 1 is obtained. When the result of the judgment S1 or S4 is obtained, the level 2 is obtained. When the result of the judgment S5 or S8 is obtained, the level 3 is obtained. When the result of the judgment S6 or S7 is obtained, the level 4 is obtained. Moreover, when the synchronous position 2 is the existing synchronous position, and when the result of the judgment S6 or S7 is obtained, the level 1 is obtained. When the result of the judgment S5 or S8 is obtained, the level 2 is obtained. When the result of the judgment S1 or S4 is obtained, the level 3 is obtained. When the result of the judgment S2 or S3 is obtained, the level 4 is obtained. When the synchronous position 3 is the existing synchronous position, and when the result of the judgment S1 or S8 is obtained, the level 1 is obtained. When the result of the judgment S2 or S7 is obtained, the level 2 is obtained. When the result of the judgment S3 or S6 is obtained, the level 3 is obtained. When the result of the judgment S4 or S5 is obtained, the level 4 is obtained. Furthermore, when the synchronous position 4 is the existing synchronous position, and when the result of the judgment S4 or S5 is obtained, the level 1 is obtained. When the result of the judgment S3 or S6 is obtained, the level 2 is obtained. When the result of the judgment S2 or S7 is obtained, the level 3 is obtained. When the result of the judgment S1 or S8 is obtained, the level 4 is obtained.

[0474] Additionally, by the judgment in each synchronous phase, it is also possible to obtain information of the phase allowances clockwise and counterclockwise.

[0475] The above-described processing is performed by the judgment circuit 107 constituted as shown in FIG. 41, and the judgment result of the stability is outputted. Concerning the output of the judgment of the stability, only the level judgment results such as the levels 1 to 4 may be outputted. Moreover, the signals of the judgments 1 to 4, judgments S1 to S8 may also be outputted together with the information indicating the existing synchronous position. In this case, the information of the existing synchronous position may not necessarily be outputted from the judgment circuit 107, and may also be outputted via the switch 104. When the outside holds set information, the information does not have to be outputted.

[0476] It is to be noted that the detection position of the signal obtained by binarizing the signal for detecting the reference position basically differs with each detection direction. Therefore, when the moving direction of the movable member does not agree with the reference position detection direction, a possibility that the judgment result on the stabilities of the optimal synchronous position and the existing reference position is meaningless is high. As the case may be, the information constitutes wrong information and possibly causes confusion. Therefore, it is sometimes desirable not to output the judgment result of the case where the moving direction of the movable member does not agree with the reference position detection direction.

[0477] Moreover, when the movable member moving in a predetermined reference position detection direction is reversed, there is a possibility that the judgment result becomes wrong.

[0478] In order to solve the above-described two problems, a method in which the judgment result is not outputted will be described in the case where the moving direction of the movable member does not agree with the reference position detection direction or is reversed midway using the example of FIGS. 39 to 41.

[0479] In the constitution of the present embodiment, the circuits shown in FIGS. 34 to 38 are used in detecting the reference position. In these circuits, it can be confirmed that the direction is not the predetermined reference position detection direction or is reversed midway by the output level of the flip flop 103 m 2 constituting a direction distinction circuit or the level change. When the direction is not the predetermined reference position detection direction or is reversed midway, the signal for detecting the reference position (f) inputted into the judgment circuit 107 is masked by the output signal of the flip flop 103 m 2 for distinguishing the direction, or the output signal of the flip flop 103 m 2 for distinguishing the direction is inputted into the judgment circuit 107. Accordingly, the output of the judgment result is masked and inhibited.

[0480] By this method, the detecting of the optimal synchronous position, and the stability judgment sequence of the existing reference position are once stopped, or the output is stopped. It is to be noted that methods other than the method described herein may also be used as long as the object can be achieved.

[0481] Next, the use of the judgment result concerning the stability of the optimal synchronous position or the existing reference position will be described.

[0482] The judgment result is stored in a storage device (not shown) in the judgment circuit 107, or outputted to the outside. Examples of an outside output destination include the display 108, the switch 104, and the outside via an interface. In the present embodiment, the judgment circuit for detecting the optimal synchronous position and for judging the stability of the existing reference position is used in common, but the judgment circuit may separately be disposed. When the setting is switched, the set information may also be exchanged between the judgment circuits.

[0483] The display 108 which is the output destination of the judgment result may be of any type as long as the result is shown. For example, there are a plurality of LEDs, the LED corresponding to the optimal synchronous position and the LED indicating the stability of the existing synchronous position are lit, blink, and are turned off at the reference position detection time. The LED indicating not only the stability but also the phase relation can be lit, flickered, and be lit. The timing of the display output of the display 108 may be set in a range in which the reference position detection processing or the judgment processing is not influenced even at the judgment time, when there is a request from the outside, or immediately before making the judgment on receiving the detection of the signal for detecting the reference position.

[0484] Furthermore, the timing of the switching of the synchronous position candidates by the switch 104 may also be set in a range in which the reference position detection processing or the judgment processing is not influenced immediately after receiving the reference position switch setting, at the judgment time, when there is the request from the outside, or immediately before making the judgment on receiving the detection of the signal for detecting the reference position.

[0485] The synchronous timing is switched by the switch 104, and the switch 104 may manually be switched, or may be switched in response to a setting command from the outside or by the switch 104 which has collected the information. When the switch 104 collects the information, a request signal for the set information may also be sent to the judgment circuit 107, storage unit, or outside if necessary. For the switching, the timing does not have to be necessarily switched, when the existing synchronous position setting is different from the optimal synchronous position, or when the stability of the existing synchronous position is low. Since the switching of the synchronous position results in the fluctuation of the reference position, it is also possible to set whether the switch is effective if necessary. For the switched setting, in the case of the switching during the reference position signal detection it is necessary to set whether the switching is applied to this detection or the next detection. It is also possible to dispose switching means if necessary.

[0486] In the output of the judgment result, it is also possible to generate an abnormal signal or a warning signal in accordance with the result. For example, when the optimal synchronous position judgment result is different from the existing synchronous position, the stability of the existing synchronous position is not more than a given level, or the change of the recorded stability satisfies a specific condition, necessity of maintenance can be transmitted by the abnormal signal or warning signal.

[0487] Next, a detection flow of the optimal synchronous position will be described with reference to FIGS. 44 and 45.

[0488] In the example of FIG. 44, it is first detected whether or not the signal for detecting the reference position is generated (step S11). Subsequently, when the generation of the signal for detecting the reference position is detected, the judgment circuit 107 detects the optimal synchronous position candidate (step S12), and outputs the judgment result (step S13). Thereafter, it is judged whether or not the setting reflects the judgment result (step S14). When the result is not reflected, the detecting flow of the optimal synchronous position ends. On the other hand, when the judgment result is reflected, the setting of the synchronous position is switched (step S15), and the detecting flow of the optimal synchronous position is ended.

[0489] Moreover, in the example of FIG. 45, it is first detected whether or not the signal for detecting the reference position is generated (step S11). Subsequently, when the generation of the signal for detecting the reference position is detected, the judgment circuit 107 detects the optimal synchronous position candidate (step S12), and outputs the judgment result (step S13). Thereafter, to reflect this judgment result, the setting of the synchronous position is switched (step S15), and the detecting flow of the optimal synchronous position is ended. Needless to say, for the reflection of the judgment result, it is possible not to set the position again, when the reflected content is the same as the existing setting.

[0490] It is to be noted that the flows shown in FIGS. 44 and 45 are the flows of the optimal synchronous position detecting. The synchronous position may be replaced with the reference position, and a flow of the optimal reference position detecting may also be constituted.

[0491] A stability judgment flow of the existing synchronous position will be described with reference to FIGS. 46 and 47.

[0492] In the example of FIG. 46, it is first detected whether or not the signal for detecting the reference position is generated (step S21). Subsequently, when the generation of the signal for detecting the reference position is detected, the judgment circuit 107 judges the stability of the existing synchronous position (step S22), and outputs the judgment result (step S23). Thereafter, it is judged whether or not the setting reflects the judgment result (step S24). When the result is not reflected, the stability judgment flow of the existing synchronous position is ended. On the other hand, when the judgment result is reflected, the setting of the synchronous position is switched (step S25), and the stability judgment flow of the existing synchronous position is ended. It is to be noted that for the reflection of the judgment result, it is possible not to set the position again, when the reflected content is the same as the existing setting.

[0493] Moreover, in the example of FIG. 47, it is first detected whether or not the signal for detecting the reference position is generated (step S21). Subsequently, when the generation of the signal for detecting the reference position is detected, the judgment circuit 107 judges the stability of the existing synchronous position (step S22), and outputs the judgment result (step S23), and the stability judgment flow of the existing synchronous position is ended.

[0494] In the example of FIG. 46, the setting of the synchronous position is switched in step S24. In the example of FIG. 47, the process ends in the step S23. However, a case where the present invention is applied to a constitution not including selecting means is also included. The timing or the step may also be replaced with the timing of the generation of the signal for detecting the reference position or the step of adjustment of the reference position, and the step may also be added.

[0495] It is to be noted that the flows shown in FIGS. 46 and 47 are the flows concerning the stability judgment of the existing synchronous phase. The synchronous position may be replaced with the reference position, and the flow of the stability judgment of the existing reference position may also be constituted.

[0496] [Effect]

[0497] According to the present embodiment, when the reference position signal is synchronized with the position detection signal, it is possible to select the synchronous position in accordance with the position (phase) of the position detection signal at the detection time of the signal for detecting the reference position. Therefore, it is possible to select the synchronous position which reduces the generation of the deviation of the reference position as much as possible, possibly caused by the unstable factors such as the signal noise or wobble, and further the stability of the light source, temperature characteristics of the light emitting/receiving device and fluctuations, and deviations from the designs of the individual encoders in the optical encoder.

[0498] In order to synchronize the reference position signal with the position detection signal, there is disposed the judgment circuit for judging the best synchronous position among the synchronous positions. In the state in which the encoder is actually attached to the apparatus, the best synchronous position can be selected. In the present embodiment, when the synchronous position having a larger phase allowance is selected, it is possible to enhance the stability against the fluctuation. Therefore, the stability of the reference position detection synchronized with the position signal increases. Moreover, the influences of the fluctuation of the relative position and posture, such as the attachment angle or gap of the head and scale at the attachment time of the encoder, do not have to be considered in advance, and an operation for performing the adjustment is omitted. That is, the phase difference between the position detection signal and reference position signal does not have to be strictly set or processed in the design and manufacturing. Therefore, the manufacturing cost or time for adjusting the assembly is reduced, and the restrictions in the design and manufacturing are reduced. This produces the advantage that the degree of freedom in the function can increase.

[0499] For the setting of a plurality of synchronous position candidates, when the Lissajous waveforms of two periodical signals having a phase difference of 90° are divided into two segments by an arbitrary straight line passing through the amplitude center, the candidates are set so as to include one or more phases of the reference position signal generating position candidates in either segment. In a setting as the one described here, for any position where the signal for detecting the reference position is generated, there will be necessarily a synchronous position candidate having a phase allowance of ±90° or more from the position. When a synchronous position candidate satisfying the condition is selected, a phase allowance of ±90° or more can be taken between the synchronous position and the phase when the signal for detecting the reference position is generated, and the stable reference position detection is possible.

[0500] When the reference position signal generating position candidates are arranged within one period of the periodical signal, the difference of the position between the reference position signal generating position candidates can be minimized. This is effective for minimizing the fluctuation of the reference position at the time of the switching of the reference position. Similarly, as described in the function of the example, in the method for storing the periodical signal for detecting the position and the signal for detecting the reference position in the vicinity of the reference position to distinguish the synchronous position closest to the generating position of the signal for detecting the reference position as the reference position, the detection position candidates are disposed within two periods in total including one period before/after the generation time of the signal for detecting the reference position. There is an effect that the fluctuation of the reference position is-reduced at the time of the switching of the reference position in conformity with the present embodiment.

[0501] In the present embodiment, the optimal synchronous position is detected by selecting the synchronous position candidate having the largest phase difference from the segment on the Lissajous waveform where the two signals for detecting the position, having a phase difference of 90°, exist when the signal for detecting the reference position is detected. Similarly, the stability of the existing synchronous position is judged by dividing the level based on the size of the phase difference between the segment on the Lissajous waveform including two signals for detecting the position, having a phase difference of 90° when the signal for detecting the reference position is generated, and the existing synchronous position.

[0502] When the concept of the segments is introduced, it is not necessary to directly obtain the position of the point on the Lissajous waveform including the signal for detecting the position in obtaining the phase allowance, or to calculate the allowance using the position, and the processing is simplified. The number of segments which can be set is two or more, such as two, four, and eight. When the number of segments is increased, finer judgment is possible, but there can be a burden in aspects of a processing capability and circuit size/cost. By setting appropriate segments in accordance with the system, an encoder can be realized which has a high stability in a reference position detection function synchronized with the position detection signal and which is compact and inexpensive.

[0503] Furthermore, as in the example of four segments of FIG. 31, when the phase allowance of each segment differs with the moving direction, the fluctuation of the phase at the detection time of the signal for detecting the reference position drifts by the change with the elapse of time. Especially when the phase allowance of one direction is noted and judged, the embodiment is effective. As shown in FIG. 32, when the number of segments is increased in the judgment of the stability of the existing synchronous position rather than the judgment of the optimal synchronous position, the embodiment is suitable for confirming the details of the change of the phase allowance or for recording the changes with the elapse of time.

[0504] It has been described that the processing is simplified by the introduction of the segments, and this results in simplification of the judgment. Furthermore, the concrete circuit constitution or calculation process is simplified, and can easily be realized. For example, two synchronous positions apart from each other by the phase of 180° and two segments constituted of half circles of 180° are disposed. In this case, the respective segments are assumed to be disposed so that each segment has a phase difference of 90° or more with respect to any synchronous position candidate. At this time, even when the point determined by the position signals (a) and (b) at the detection time of the signal for detecting the reference position is included in any segment, an appropriate synchronous position candidate can be selected to obtain a phase difference of 90° or more. When two synchronous positions are disposed on the vertical axis or the horizontal axis in FIGS. 31 and 32, the synchronous position which differs in the level of the binarized position signal between the detection time of the signal for detecting the reference position (f) and the synchronous position is selected. Only with two segments, two synchronous positions, and simple judgment standard, the optimal synchronous position can easily be detected, and the reference position detection which has the high precision and which is stable is possible. Furthermore, this judgment standard can easily be applied to the circuit using the flip flop, or FPGA or CPU in which the equivalent processing is possible.

[0505] In the present embodiment, as shown in FIG. 31, even when two segments constituted of the half circles of 180° are further finely divided, it is assumed that there are only two segments, and the processing is carried out. Accordingly, the similar judgment processing is possible. By the fine division, the phase allowance can finely be confirmed for each moving direction. Even when the number of segments is four, the segment can easily be judged in the AND circuit and NOT circuit. Even when the number of segments is eight, about one or two units each of the comparator, operating amplifier, and resistance can be used to easily judge the segments. Therefore, the fine segments can be used for the simple circuit to obtain the detailed judgment result.

[0506] Furthermore, the display section of the judgment result can be realized by a plurality of LEDs or a number display unit whose number digits correspond to seven segments. The burden by the addition is light, but the securing of the stability of the reference position detection synchronized with the position signal and the judgment of the stability can easily be realized.

[0507] Moreover, in the present embodiment, except the signal processing circuit section, the member for generating the auxiliary signal is not disposed for the reference position detection. Therefore, the reference position can stably be detected, and the small-sized and inexpensive encoder can be supplied.

[0508] Furthermore, in the present embodiment, the reference position can be detected only with the displacement in the given direction. This produces the advantages that the detection is not easily influenced by the backlashes of the movable part and the reference position does not have to be doubly detected at the reference position detection time. The reference position detection high in precision and convenient in use is possible.

[0509] Additionally, the behavior of the system can be confirmed from the judgment result successively stored in the storage unit with the elapse of time. For example, in the segments of FIG. 30, the shift to the adjacent segment result from the certain segment result is possibly caused by the slight fluctuation of the constitution of the movable member or the detection system. Even when the result can be tolerated, but when there is a given or more fluctuation, or when the different result is obtained every measurement, it can be judged that there is a problem. Also in the reference position, only when there is not any fluctuation after obtaining the reference position, the position is satisfactory. In this case, for example, it is possible to obtain the reference position at the rise of the system and to reselect the optimal synchronous position every time, and self adjustment is possible with respect to the moderate fluctuation with the elapse of time.

THIRTEENTH EMBODIMENT

[0510] Next, a thirteenth embodiment of the present invention will be described. In the same manner as in the eighth embodiment, the major constitution of the encoder according to the present embodiment except the signal processing circuit section 6 is not especially limited as long as the position detection signal and the signal for detecting the reference position are obtained. For example, the general constitution may be used such as the optical constitution shown as the constitution of the major part of the above-described first embodiment in FIG. 1. In the example of FIG. 1, the optical encoder has been described, but another type of the encoder or the displacement sensor such as the magnetic/electrostatic type may also be used as long as the position signal and reference position signal are obtained in accordance with the displacement amount.

[0511] Moreover, the signal processing circuit section 6 in the thirteenth embodiment is constituted as shown in FIG. 48. That is, the signal processing circuit section 6 according to the thirteenth embodiment includes: a phase interpolation circuit 110 for dividing the phase difference based on the analog position signals (a) and (b) having the phase difference of 90° to output N sinusoidal signals (k1) to (kN); the binarizing circuit 101 for generating N digital signals (p1) to (pN) from these N sinusoidal signals (k1) to (kN) and reference signal (j); a pulse generation circuit 111 for generating pulse signals (da) and (db) in accordance with the displacement amount of the movable member based on these N digital signals (p1) to (pN); the binarizing circuit 102 for binarizing the signal for detecting the reference position (e) at the predetermined slice level to convert the signal to the digital signal for detecting the reference position (f); the latch circuit 106 for latching the digital signal for detecting the reference position (f); the synchronous circuit 103 for synchronizing the latched digital signal for detecting the reference position (f) with one of N digital signals (p1) to (pN) which is the position signal to generate the reference position signal (g); the switch 104 for switching the timing of the synchronization; the judgment circuit 107 for detecting the optimal synchronous position and judging the stability of the existing synchronous position; and the display 108 for displaying the judgment result.

[0512] Here, when the sinusoidal signal (k1) is equal to the position signal (b) and the position signal (b), that is, the sinusoidal signal (k1) is sin θ, N sinusoidal signals (k1) to (kN) are represented by a sinusoidal signal (k1), where i=1 to N, as follows:

(ki)=sin [θ−360°/N•(i−1)]  (Equation 9)

[0513] The N sinusoidal signals (k1) to (kN) are generated by the phase interpolation circuit 110 in the present embodiment, but any constitution or method may also be used as long as the signal satisfying (Equation 9) is obtained. For example, the reversed signals are obtained from two signals having the phase difference of 90° by a reverse amplifier, and a multiphase signal including about three to eight phases may be generated by addition/subtraction of these signals. The signals such as three-phase signals originally having a phase difference of 120° may directly be inputted.

[0514] Moreover, the reference signal (j) is a reference signal indicating the amplitude center level of the position signals (a) and (b), and is used in the phase interpolation circuit 110 and binarizing circuit 101.

[0515] The reference position signal generating position candidates and the segments of the Lissajous figure of the analog position signals (a) and (b) will be described with FIG. 49. On the Lissajous circle, N positions (phases) which are the reference position signal generating position candidates are arranged every phase difference of (360°/N) with respect to the periods of the position signals (a) and (b), while the synchronous position 1 is on the plus side on the horizontal axis. For the detecting of the optimal synchronous position and the judgment of the stability of the existing synchronous position, N segments divided by the phases of N reference position signal generating position candidates are disposed, and as shown in FIG. 49, numbers (1) to (N) are attached to the segments counterclockwise starting from the plus side of the horizontal axis.

[0516] The binarizing circuit 101 in the signal processing circuit section 6 is constituted as shown in FIG. 50. That is, the position signals (k1) to (kN) are compared with the reference signal (j) by comparators 101 a 1 to 101 aN to generate binarized signals (d1) to (dN). Furthermore, XOR circuits 101 b 1 to 101 bN take an exclusive logical sum (XOR) with binarized signals (di) and (di+1) disposed adjacent to each other (additionally, i=1 to N). Here, at i=N, the exclusive logical sum of the binarized signals (dN) and (d1) is assumed to be obtained. Moreover, AND circuits 101 c 1 to 101 cN obtain a signal (pi) (additionally, i=1 to N) which indicates the result of the exclusive logical sum and the result of the logical product (AND) with the binarized signal (di).

[0517] The synchronous circuit 103 in the signal processing circuit section 6 includes a constitution of FIGS. 51A and 51B. Here, FIG. 51B is a diagram showing the concrete example of a reference position detection circuit 103 n for generating the reference position signal synchronized with the position signal as shown in FIG. 51A. For two circuits including the detection circuit of the signal for detecting the reference position and the direction distinction circuit in this concrete example, the flip flops such as LS423 of the D-C trigger type are used.

[0518] In the concrete example shown in FIG. 51B, a flip flop 103 n 1 constituting the detection circuit of the signal for detecting the reference position, which outputs the value of the latched signal for detecting the reference position (f) at the rise of the signal (pi) (additionally, i=1 to N); a flip flop 103 n 2 constituting the direction distinction circuit which detects the displacement counterclockwise on the Lissajous circle; and an AND circuit 103 n 3 for obtaining the logical product of these outputs constitute the detection circuit 103 n which detects that the latched signal for detecting the reference position (f) reaches the high level and is in the set synchronous position. That is, the signal for detecting the reference position (f) latched by the latch circuit 106 is inputted into the data D of the flip flop 103 n 1, the signal (pi) is inputted into the clock CLK, and the output Q is inputted into the AND circuit 103 n 3. The position signal (p2) is inputted into the data D of the flip flop 103 n 2, the position signal (p1) is inputted into the clock CLK, and the output {overscore (Q)} is inputted into the AND circuit 103 n 3.

[0519] Moreover, the judgment circuit 107 is assumed to include a constitution of FIG. 52. That is, in FIG. 52, the position signals (p1) to (pN), the latched signal for detecting the reference position (f), and existing reference position designation are assumed to be input signals. The circuit is constituted of the latch circuit 107 m and stability judging section 107J. Here, the latch circuit 107 m latches the position signals (p1) to (pN) at the rise of the latched signal for detecting the reference position (f). It is assumed that the outputs of the latch circuit 107 m are detection results (1) to (N) of the optimal synchronous position. The stability judging section 107J receives these judgment results (1) to (N) and the information of the existing reference position designation which are inputs to output the stability judgment result of the existing synchronous position.

[0520] The designation situation and judgment result of the existing reference position are stored in the storage unit (not shown) in the signal processing circuit section 6, the storage unit (not shown) disposed in the switch 104 or the judgment circuit 107, any of external storage units connected to the outside of the signal processing circuit section 6, or a plurality of storage units among these. This storage unit is mainly constituted of the storage mediums, and also constituted of the logic array or CPU for processing the judgment result or for the input/output if necessary. In the storage unit, the judgment result from the judgment circuit 107 is stored, and the judgment result is outputted to the outside. Moreover, the storage unit is constituted so as to send the judgment result to the switch 104 to switch the position to the synchronous position judged as optimal. For the storage unit, the nonvolatile storage mediums are desirable such as SRAM and flash ROM in which the information is maintained even when power is turned off.

[0521] [Operation]

[0522] The processing of the input from the photodetector 5 shown in FIG. 1 by the signal processing circuit section 6 in the present embodiment will be described with reference to a part of the time chart in FIGS. 42 and 43. FIG. 42 shows the displacement in the counterclockwise direction on the Lissajous circle, and FIG. 43 shows the displacement in the clockwise direction on the Lissajous circle.

[0523] The two analog position signals (a) and (b) of the encoder which periodically change with the displacement (relative movement of the scale 4) and which have a phase difference of 90° are phase-divided in the phase interpolation circuit 110 to obtain N position signals (k1) to (kN). These position signals (k1) to (kN) are digitized in the binarizing circuit 101 to obtain the digital signals (p1) to (pN). In the binarizing circuit 102, the signal for detecting the reference position (e) is binarized at the predetermined slice level to obtain the digital signal for detecting the reference position (f). In the latch circuit 106, the rise of the digital signal for detecting the reference position (f) is detected to set the latch signal (i) to the high level.

[0524] In the region where the latch signal (i) indicates the high level, the synchronous circuit 103 generates the reference position signal as follows. That is, after the generation of the latch signal (i), the signal is synchronized with the first rise of the position signal (pi) (additionally, i=1 to N) to obtain the high level, and synchronized with the fall of the position signal (pi) to obtain the low level, so that the reference position signal (g) is obtained. The desired reference position signal (g) is obtained by switching the value of i from 1 to N and selecting one from N detection positions.

[0525] The example of FIG. 51A shows a circuit which receives the position signals (p1) to (pN), and the latched signal for detecting the reference position (f), that is, the latch signal (i) as the inputs to generate the reference position signal in the synchronous position set after the signal for detecting the reference position (f) reaches the high level. It is to be noted that the synchronous circuit 103 is not necessarily limited to the constitution of the present embodiment. For example, the function of distinguishing the direction can be realized based on the input signal, but the function of distinguishing the direction is not necessarily included.

[0526]FIG. 51B shows a circuit constitution for detecting the reference position at the time of the displacement in the counterclockwise direction on the Lissajous circle.

[0527] The direction distinction will first be described. The position signal (p2) is inputted into the data D of the flip flop 103 n 2, and the position signal (p1) is inputted into the clock CLK. As a result, the signal outputted from the output {overscore (Q)} of the flip flop 103 n 2 is updated as the reversed signal of the position signal (p2) at every rise of the position signal (p1). Therefore, only when the position signal (p2) indicates the low level at the time of the rise of the position signal (p1), the output {overscore (Q)} of the flip flop 103 n 2 indicates the high level, and the direction distinction is therefore possible.

[0528] For the circuit for detecting the signal for detecting the reference position, the latch signal (i) is inputted into the data D of the flip flop 103 n 1, and the position signal (pi) is inputted into the clock CLK. As a result, the signal outputted from the output Q of the flip flop 103 n 1 is updated as the latch signal (i) every rise of the position signal (pi). As a result, it is possible to output the signal for detecting the reference position synchronized at the timing of the rise of the position signal (pi) after the signal for detecting the reference position is detected.

[0529] Moreover, when the AND circuit 103 n 3 obtains the logical product of the direction distinction signal and the synchronized signal for detecting the reference position, it is possible to generate the reference position signal (g) shown in FIG. 42 in the predetermined detection direction and timing. On the other hand, with the displacement in the opposite direction, the reference position signal is not detected as shown by the signal (g) of FIG. 43.

[0530] Furthermore, the position is detected by inputting the pulse signals (da) and (db) generated by the pulse generation circuit 111 into the counter (not shown). The counter is reset when the reference position signal (g) is generated, or the appropriate preset value is set, and it is possible to obtain the reference position of the position detection.

[0531] Next, the candidates of the synchronous position and the detecting of the optimal synchronous position will be described with reference to FIG. 52. The optimal synchronous position is detected by judging the segment where the point determined by the position signals (a) and (b) exists at the rise, indicating the detection, of the signal for detecting the reference position (f).

[0532] Basically, for the segments and synchronous position candidates, the phase allowances with all the synchronous position candidates are determined in the stepwise manner for each segment, and the synchronous position candidate having the largest phase allowance is regarded as optimal and outputted. In the present embodiment, assuming that the number of segments is two, the number of synchronous position candidates is two, and the phase allowance is represented from 0° to 180°, the phase allowance is optimal when the phase difference is largest. With respect to the phase allowance, as seen in a case where the processing is not performed in real time, when the phase difference is represented from 0° to 180°, conversely the candidate in the vicinity of 0° may be regarded as optimal.

[0533] In FIG. 52, there are N synchronous position candidates including synchronous positions 1 to N every (360°/N) phase. For a case where the segment including the point determined by the position signals (a) and (b) at the rise of the signal for detecting the reference position (f) is (i), N which is an even or odd number will dividedly be described.

[0534] When N denotes an even number, for j=[(i+N/2) mod N], the phase difference with respect to the synchronous positions j and (j+1) is largest as (180°-360°/N). Therefore, the synchronous position j or (j+1) is judged as the optimal synchronous position. Additionally, (M mod N) denotes a remainder obtained by dividing M by N, and includes numbers of 0 to (N−1).

[0535] When N denotes an odd number, for j=[{i+(N+1)/2} mod N], the phase difference with respect to the synchronous position j is largest as (180°-180°/N) Therefore, the synchronous position j is judged as the optimal synchronous position.

[0536] Next, concerning the segment for use in detecting the optimal synchronous position candidate, the detection of the segment where the point determined by the position signals (a) and (b) is included at the detection time of the signal for detecting the reference position (f) will be described with reference to FIGS. 50 and 52.

[0537] In FIG. 50, each position signal (di) is obtained by binarizing the position signal (ki), and repeatedly indicates the high and low levels every semi-period. The position signals (d1) to (dN) are the signals for each (360°/N) phase difference. When the number of subscripts increases, the phase delays. Therefore, the XOR circuits 101 b 1 to 101 bN obtains the exclusive logical sum of the position signals (di) and (di+1), and the AND circuits 101 c 1 to 101 cN obtains the logical product of the results and the position signal (di). When the result is applied to (Equation 9), the position signal (pi) indicates the high level only with θ between 360°∘(i−1)/N and 360°∘i/N. Therefore, when the segment including the point determined by the position signals (a) and (b) is (i), from (Equation 9), only the signal (pi) indicates the high level.

[0538] From the above, as shown in FIG. 52, when the position signals (p1) to (pN) are latched at the detection time of the signal for detecting the reference position (f), and the high-level position signal is (pi), it can be seen that the segment including the point determined by the position signals (a) and (b) at the detection time of the signal for detecting the reference position (f) is the segment (i).

[0539] From the above, the position signals (p1) to (pN) are latched at the time of the detection of the signal for detecting the reference position (f), and the position signal indicating the high level is (pi), that is, in FIG. 52, the judgment i indicates the high level. The logic of the judgment of the optimal synchronous position at this time will be described dividedly for N which is the even or odd number. When N denotes the even number, for j=[(i+N/2) mod N], the phase difference with respect to the synchronous positions j and (j+1) is largest as (180°-360°/N) Therefore, the synchronous position j or (j+1) is judged as the optimal synchronous position. When N denotes the odd number, for j=[{i+(N+1)/2} mod N], the phase difference with respect to the synchronous position j is largest as (180°-180°/N). Therefore, the synchronous position j is judged as the optimal synchronous position.

[0540] Next, for a case where the synchronous position is set to (i), and the segment including the point determined by the position signals (a) and (b) at the detection time of the signal for detecting the reference position (f) is (j), the method for judging the stability of the synchronous position will be described. For the way of judgment, in the same manner as in the judgment of the optimal synchronous position, it is assumed that when the phase difference between the segment included at the rise of the signal for detecting the reference position (f) and the synchronous position is larger, the stability is high. When the phase difference is smaller, the stability is low.

[0541] From FIG. 49, minimum values of the phase difference between the synchronous position i and the segment (j) can be obtained in the counterclockwise and clockwise directions. Assuming that the value of the counterclockwise direction is θ+ and that of the clockwise direction is θ−, θ+ and θ− are:

θ+=[(j−i)mod N]∘360°/N   (Equation 10)

θ−=[(i−j−1)mod N]∘360°/N   (Equation 11)

[0542] In θ+ and θ−, θmin is assumed to be smaller, and θmin is then the phase allowance. The allowance can be judged by the value of θmin.

[0543] The phase difference θmin takes a stepwise value. When N denotes the even number, (N/2) steps result. Moreover, when N denotes the odd number, [(N+1)/2] steps result. For the number of steps, when the adjoining steps are put together into one based on the specifications of the judgment level dividing if necessary, the number of steps can be reduced.

[0544] It is to be noted that in the present embodiment, the segment for use in judging the stability is the same as that for use in detecting the optimal synchronous position. Therefore, the description is omitted.

[0545] From the above, the position signals (p1) to (pN) are latched at the time of the detection of the signal for detecting the reference position (f), and the position signal indicating the high level is (pj), that is, in FIG. 52, the judgment i indicates the high level. The logic of the judgment of the stability with respect to the existing synchronous position i at this time will be described hereinafter.

[0546] In θ+ and θ− represented in (Equation 10) and (Equation 11), θmin is assumed to be smaller, and the phase allowance is judged in accordance with the value of θmin in advance. At this time, the value of θmin takes a discrete value. When N denotes the even number, (N/2) steps result. When N denotes the odd number, [(N+1)/2] steps result. The level is judged based on the values of i and j by the stability judging section 107J, and outputted to the outside. It is to be noted that only the values of i and j may be outputted from the stability judging section 107J so that the stability can be judged outside.

[0547] The use of the judgment result concerning the optimal synchronous position or the stability of the reference position is similar to that of the twelfth embodiment, and details are therefore omitted.

[0548] [Effect]

[0549] In the present embodiment, substantially the same effect as that of the twelfth embodiment can be obtained.

[0550] As the effect peculiar to the present embodiment, in the circuit for generating the multiphase signal including about three to eight phases by the addition/subtraction of the 90° phase difference signal and the reversed signal or dividing the phases by resistance division in order to adjust gain offset or to correct the phase of the signal having the phase difference of 90°, a circuit for the judgment can be shared to some degree.

[0551] The former generation of the multiphase signal by the addition/subtraction can be regarded as a part of the phase interpolation in a broad detect, and can be applied to the present embodiment. Especially in the circuit for performing the phase interpolation by the resistance division, AB phase signals and reversed signals are weighted and added/subtracted to divide one period of 360° of the AB phase into N, so that N signals are generated at an interval of the phase difference (360°/N), or the function can easily be added. In most cases, a comparator circuit for detecting intersection between N analog phase difference signals and the reference signal is already disposed. Therefore, the phase synchronization function of the reference position signal or the phase position at the specific timing is relatively easily detected. Furthermore, to detect the phase synchronization function of the reference position signal or the phase position at the specific timing, the same detection method is applied to all the synchronous position candidates. Similarly, the same detection method is applied to the detection of all the segments. Therefore, although there are a large number of synchronous position candidates and segments, the circuit can be simplified.

[0552] Moreover, in the phase interpolation, usually the phase is divided into about several tens to thousands of phases. Therefore, since a large number of synchronous position candidates and segments are disposed, the detection of the optimal synchronous position and the judgment of the stability of the existing synchronous position can finely be performed.

[0553] As described above, the content of the present embodiment can easily be applied to the reference position detection of the displacement sensor which has a function of dividing the phase by the resistance division. Merits of miniaturization and cost reduction by IC can be provided which are merits of the phase interpolation by the resistance division.

[0554] The present invention has been described above based on the embodiments, but the present invention is not limited to the above-described embodiments, and can, needless to say, variously be modified and applied in the scope of the present invention.

[0555] Additional advantages and modifications will readily occur to those skilled in the art. Therefore, the invention in its broader aspects is not limited to the specific details and representative embodiments shown and described herein. Accordingly, various modifications may be made without departing from the spirit or scope of the general invention concept as defined by the appended claims and their equivalents. 

What is claimed is:
 1. A displacement sensor which detects a positional displacement of a movable member, comprising: a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member; a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position, when the movable member is in a predetermined position; a reference position detection circuit configured to detect that the movable member is in a reference position, the detection being based on the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position and being in synchronization with the periodical signal generated by the position signal generating section; and a selecting section configured to be capable of selecting a phase position to be synchronized from a plurality of phase positions on the periodical signal in the synchronization in the reference position detection circuit.
 2. The displacement sensor according to claim 1, wherein the periodical signal generated by the position signal generating section is an analog signal, and the synchronization in the reference position detection circuit is established in one of a position where the analog periodical signal intersects with a substantially middle value from below and a position where the analog periodical signal intersects with the value from above.
 3. The displacement sensor according to claim 1, wherein the periodical signal generated by the position signal generating section is a digital signal, and the synchronization in the reference position detection circuit is established in one of a rise position and a fall position of the digital periodical signal.
 4. The displacement sensor according to claim 1, wherein the reference position is detected only when the movable member moves in a predetermined direction.
 5. A displacement sensor which detects a positional displacement of a movable member, comprising: a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member; a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position, when the movable member is in a predetermined position; a latch section configured to latch the signal for detecting the reference position, generated by the generating section of the signal for detecting the reference position; and a reference position detection circuit configured to detect that the movable member is in a reference position based on the signal generated by the latch section in synchronization with the periodical signal generated by the position signal generating section.
 6. The displacement sensor according to claim 1, further comprising: a generating section of a signal for detecting a reference position configured to generate a plurality of signals for detecting the reference position.
 7. A displacement sensor which detects a positional displacement of a movable member, comprising: a position signal generating section configured to generate a plurality of periodical signals in accordance with movement of the movable member; a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position, when the movable member is in a predetermined position; a selecting section configured to be capable of selecting one periodical signal from the periodical signals generated by the position signal generating section; and a reference position detection circuit configured to detect that the movable member is in a reference position, the detection being based on the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position and being in synchronization with the periodical signal selected by the selecting section.
 8. A displacement sensor which irradiates a movable member with a light from a light source and receives a returned light by a light receiving section to detect a positional displacement of the movable member, comprising: a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member; a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position, when the movable member is in a predetermined position; and a reference position detection circuit configured to detect that the movable member is in a reference position, the detection being based on the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position and being in synchronization with the periodical signal generated by the position signal generating section, wherein the light source and light receiving section are formed in the same substrate by a semiconductor process.
 9. The displacement sensor according to claim 8, wherein the periodical signal generated by the position signal generating section is an analog signal, and the synchronization in the reference position detection circuit is established in one of a position where the analog periodical signal intersects with a substantially middle value from below and a position where the analog periodical signal intersects with the value from above.
 10. The displacement sensor according to claim 8, wherein the periodical signal generated by the position signal generating section is a digital signal, and the synchronization in the reference position detection circuit is established in one of a rise position and a fall position of the digital periodical signal.
 11. A displacement sensor which detects a positional displacement of a movable member, comprising: a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member; a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position of position detection, when the movable member is in a predetermined position; a reference position detection circuit configured to detect that the movable member is in a reference position, the detection being based on the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position and being in synchronization with the periodical signal generated by the position signal generating section; a selecting section configured to be capable of selecting a phase position to be synchronized from a plurality of phase positions on the periodical signal in the synchronization in the reference position detection circuit; and a judging section configured to detect an optimal synchronous position among the phase positions on the periodical signal.
 12. The displacement sensor according to claim 11, wherein the periodical signals generated by the position signal generating section include two position detection signals which have a phase difference of about 90°, the displacement sensor is a displacement sensor which synchronizes one of the position detection signals with the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position, and the judging section detects the optimal synchronous position based on the signal level of the other position detection signal when the signal for detecting the reference position is generated, and also based on the advance or delay of its phase from the position signal to be synchronized.
 13. The displacement sensor according to claim 11, wherein the periodical signals generated by the position signal generating section are two analog position detection signals which have a phase difference of about 90°, the displacement sensor is a displacement sensor which synchronizes one of the analog position detection signals with the signal for detecting the reference position generated by the generating section of the signal for detecting the reference position, segments exist which are able to be generated by dividing a Lissajous waveform of the two position detection signals into a plurality of segments, and the judging section detects an optimal synchronous position based on one of the segments where the two position detection signals exist when the signal for detecting the reference position is generated.
 14. The displacement sensor according to claim 13, wherein the number of the segments is eight.
 15. A displacement sensor which detects a positional displacement of a movable member, comprising: a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member; a generating section of a signal for detecting a reference position, configured to generate the signal for detecting the reference position of position detection, when the movable member is in a predetermined position; a latch section configured to latch the signal for detecting the reference position, generated by the generating section of the signal for detecting the reference position; a reference position detection circuit configured to detect that the movable member is in a reference position based on a signal generated by the latch section in synchronization with the periodical signal generated by the position signal generating section; a selecting section configured to be capable of selecting a phase position to be synchronized from a plurality of phase positions on the periodical signal in the synchronization in the reference position detection circuit; and a judging section configured to detect an optimal synchronous position among the phase positions on the periodical signal.
 16. The displacement sensor according to claim 11, further comprising: a data storage section in which the detected optimal synchronous position is recorded.
 17. A displacement sensor which detects a positional displacement of a movable member, comprising: a position signal generating section configured to generate a periodical signal in accordance with movement of the movable member; a generating section of signals for detecting a reference position, configured to generate a plurality of signals for detecting the reference position, none of their mutual phase differences being integer times one period of the periodical signal, when the movable member is in a predetermined position; a selecting section configured to be capable of selecting one signal for detecting the reference position from the signals for detecting the reference position, generated by the generating section of the signal for detecting the reference position; a reference position detection circuit configured to detect that the movable member is in a reference position based on the selected signal for detecting the reference position in synchronization with the periodical signal generated by the position signal generating section; and a judging section configured to detect a signal for detecting the reference position, which is optimal for synchronization with the position signal among the signals for detecting the reference position.
 18. A displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member to generate a reference position signal, when the movable member is in a predetermined range, the displacement sensor comprising: a plurality of reference position signal generating position candidates where the reference position signals are generated; and a selecting section configured to select one candidate from the reference position signal generating position candidates and switch the reference position signal generating position to the candidate.
 19. The displacement sensor according to claim 18, further comprising: a judging section configured to detect an optimal candidate from the reference position signal generating position candidates, wherein the selecting section is able to select the reference position signal generating position based on a judgment result from the judging section.
 20. The displacement sensor according to claim 19, wherein the reference position is detected only when the movable member moves in a predetermined direction.
 21. The displacement sensor according to claim 18, wherein the reference position signal generating position is automatically selected and switched based on a judgment result by the judging section.
 22. The displacement sensor according to claim 18, further comprising: a display unit configured to display a judgment result.
 23. The displacement sensor according to claim 18, wherein the judgment for the optimal candidate is performed only when the movable member moves in a direction for detecting the reference position.
 24. The displacement sensor according to claim 19, further comprising: a stability judging section configured to judge stability of the existing reference position signal generating position, wherein the stability judging section judges the stability of the existing reference position signal generating position, when the detection of the optimal reference position signal generating position candidate is being performed.
 25. The displacement sensor according to claim 18, wherein there are N, an integer of 2 or larger, reference position signal generating position candidates, and the phases of the periodical signal in the N reference position signal generating position candidates are disposed at intervals of (360°/N).
 26. The displacement sensor according to claim 18, wherein the reference position signal generating position candidates correspond to a plurality of phases of the periodical signal, and the selecting section is able to switch the reference position signal generating position to one of the phases.
 27. The displacement sensor according to claim 26, further comprising: a judging section configured to detect an optimal candidate from the reference position signal generating position candidates, wherein the selecting section is able to select the reference position signal generating position based on a judgment result from the judging section.
 28. The displacement sensor according to claim 27, wherein the signal for detecting the reference position, which is not necessarily synchronized with the periodical signal, is generated when the movable member is in a predetermined range, and the judging section detects the optimal candidate based on the difference between the phase of the periodical signal when the signal for detecting the reference position is generated and that in each reference position signal generating position candidate.
 29. The displacement sensor according to claim 28, wherein assuming that the phase difference is represented from 0° to 180° with respect to the phase of the periodical signal when the signal for detecting the reference position is generated and that in each reference position signal generating position candidate, the judging section judges that the reference position signal generating position candidate having a largest phase difference is optimal.
 30. The displacement sensor according to claim 27, further comprising: a stability judging section configured to judge stability of the existing reference position signal generating position based on phase margin between the phase of the periodical signal when the signal for detecting the reference position is generated and that in the reference position signal generating position, wherein the stability judging section detects an optimal reference position signal generating position candidate and also judges the stability of the existing reference position signal generating position.
 31. The displacement sensor according to claim 26, wherein the periodical signals are periodical signals which have the same period and a phase difference of about 90°.
 32. The displacement sensor according to claim 31, wherein a two-dimensional rectangular coordinate system is disposed so that an output of one of the two periodical signals is taken in the horizontal axis direction, that the output of the other is taken in the vertical axis direction, and that values of coordinates in the intersection of the vertical and horizontal axes agree with amplitude center values of the outputs of the two periodical signals, and a waveform drawn by a point determined by the outputs of the two periodical signals with the displacement of the movable member on the coordinate system is defined as the Lissajous waveform of the two periodical signals, and at least one of the phases of the reference position signal generating position candidates is included in either segment, when the Lissajous waveform of the two periodical signals is divided into two segments by any straight line passing through the amplitude center of the two periodical signals.
 33. The displacement sensor according to claim 31, further comprising: a judging section configured to detect an optimal candidate from the reference position signal generating position candidates, wherein the selecting section is able to select the reference position signal generating position based on a judgment result of the judging section.
 34. The displacement sensor according to claim 33, wherein the signal for detecting the reference position, which is not necessarily synchronized with the periodical signal, is generated when the movable member is in a predetermined range, and the judging section detects the optimal candidate based on the difference between the phase of the periodical signal when the signal for detecting the reference position is generated and that in each reference position signal generating position candidate.
 35. The displacement sensor according to claim 34, wherein assuming that the phase difference is represented from 0° to 180° with respect to the phase of the periodical signal when the signal for detecting the reference position is generated and that in each reference position signal generating position candidate, the judging section judges that the reference position signal generating position candidate having a largest phase difference is optimal.
 36. The displacement sensor according to claim 31, wherein there are two reference position signal generating position candidates, and there is a difference of 180° between the phases of the periodical signals at the two reference position signal generating position candidates.
 37. The displacement sensor according to claim 36, wherein a coordinate system is disposed so that an output of one of the two periodical signals is taken in the horizontal axis direction of a two-dimensional orthogonal coordinate system, the output of the other is taken in the vertical axis direction, and values of coordinates in intersections of the vertical and horizontal axes agree with amplitude center values of the outputs of the two periodical signals, a waveform drawn by a point determined by the outputs of the two periodical signals with the displacement of the movable member on the coordinate system is a Lissajous waveform of the two periodical signals, and a combination of two intersections of the Lissajous waveform of the two periodical signals with either one of the vertical and horizontal axes are regarded as the phases of the reference position signal generating position candidates.
 38. The displacement sensor according to claim 31, wherein a coordinate system is disposed so that an output of one of the two periodical signals is taken in the horizontal axis direction of a two-dimensional orthogonal coordinate system, the output of the other is taken in the vertical axis direction, and values of coordinates in intersections of the vertical and horizontal axes agree with amplitude center values of the outputs of the two periodical signals, a waveform drawn by a point determined by the outputs of the two periodical signals with the displacement of the movable member on the coordinate system is a Lissajous waveform of the two periodical signals, the signal for detecting the reference position, which is not necessarily synchronized with the periodical signals, is generated when the movable member is in the predetermined range, and a segment including a point determined by the two periodical signals is able to be distinguished among a plurality of segments obtained by dividing the Lissajous waveform of the two periodical signals at least when the signal for detecting the reference position is generated.
 39. The displacement sensor according to claim 38, wherein the segments are obtained by dividing the Lissajous waveform of the two periodical signals so that corresponding displacement amount of each segment is substantially equal.
 40. The displacement sensor according to claim 38, further comprising: a judging section configured to detect an optimal reference position signal generating position candidate among the reference position signal generating position candidates based on the segment on the Lissajous waveform in which a point determined by the two periodical signals exists when the signal for detecting the reference position is generated, wherein the selecting section is able to select the reference position signal generating position based on a judgment result of the judging section.
 41. The displacement sensor according to claim 40, wherein assuming that the phase difference is represented from 0° to 180° with respect to each phase difference between the phase of the periodical signal in the segment on the Lissajous waveform in which the point determined by the two periodical signals exists when the signal for detecting the reference position is generated and the phase of the periodical signal in a reference position signal generating position candidate, the judging section regards a minimum value of the phase difference within a segment as the phase difference between the segment and each reference position signal generating position candidate with respect to a combination of the segment and the reference position signal generating position candidate, and judges that the reference position signal generating position candidate having a largest phase difference is optimal.
 42. The displacement sensor according to claim 38, wherein the number of segments is two.
 43. The displacement sensor according to claim 42, wherein the segments are the two segments obtained by dividing the Lissajous waveform of the two periodical signals by one of the vertical and horizontal axes.
 44. The displacement sensor according to claim 43, wherein when two intersections of the Lissajous waveform with the vertical axis are the phases of the reference position signal generating position candidates, and two segments are obtained by dividing the Lissajous waveform of the two periodical signals by the horizontal axis, the judging section judges that the reference position signal generating position candidate included in a segment different from that on the Lissajous waveform in which the point determined by the two periodical signals exists when the signal for detecting the reference position is generated is optimal.
 45. The displacement sensor according to claim 44, wherein the judging section judges that the reference position signal generating position candidate is optimal in which a binarized signal of the periodical signal corresponding to the vertical axis among the two periodical signals takes a signal level different from that when the signal for detecting the reference position is generated.
 46. The displacement sensor according to claim 38, wherein the number of segments is four.
 47. The displacement sensor according to claim 46, wherein the four segments are obtained by dividing the Lissajous waveform of the two periodical signals by the vertical and horizontal axes.
 48. The displacement sensor according to claim 46, wherein the four segments are obtained by dividing the Lissajous waveform by two straight lines which pass through the intersections of the vertical and horizontal axes and which have an inclination of ±45° with respect to the horizontal axis.
 49. The displacement sensor according to claim 38, wherein the number of segments is eight.
 50. The displacement sensor according to claim 49, wherein the eight segments are obtained by dividing the Lissajous waveform of the two periodical signals by four straight lines including the vertical and horizontal axes and two straight lines which pass through the intersections of the vertical and horizontal axes and which have an inclination of ±45° with respect to the horizontal axis.
 51. The displacement sensor according to claim 31, wherein a plurality of signals for detecting the reference position, which are not necessarily synchronized with the periodical signals, are generated when the movable member is in the predetermined range, there are reference position signal generating position candidates as many as at least some of the signals for detecting the reference position, there is a one-to-one correspondence between at least some of the signals for detecting the reference position and the reference position signal generating position candidates, and the selecting section uses the corresponding signal for detecting the reference position in detecting the phase of one reference position signal generating position candidate.
 52. The displacement sensor according to claim 26, wherein there are at least three periodical signals which have the same period, there are the same number of reference position signal generating position candidates as that of periodical signals, there is a one-to-one correspondence between the reference position signal generating position candidates and the periodical signals, and the selecting section uses the corresponding periodical signal in detecting the phase of a reference position signal generating position candidate.
 53. The displacement sensor according to claim 26, wherein the phases of the reference position signal generating position candidates are detected, when at least one of the periodical signals intersects substantially with an amplitude center value of the periodical signal.
 54. The displacement sensor according to claim 26, wherein there is a pulse signal obtained by binarizing at least one of the periodical signals, and the phases of the reference position signal generating position candidates are detected by one of rise and fall of the pulse signal and the moving direction of the movable member.
 55. The displacement sensor according to claim 18, wherein the reference position signal generating position candidates are disposed within two periods of the periodical signals.
 56. The displacement sensor according to claim 18, wherein the signal for detecting the reference position is generated and latched, when the movable member is in the predetermined range, and a reference position signal is generated being synchronized with at least one of the periodical signals, after the signal for detecting the reference position is latched.
 57. The displacement sensor according to claim 52, wherein the at least three periodical signals are generated by phase interpolation based on any of two, three, and four signals which have a 90° phase difference.
 58. The displacement sensor according to claim 18, wherein the reference position is detected, only when the movable member moves in a predetermined direction.
 59. A method for detecting an optimal reference position candidate of a displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the displacement sensor generating a signal for detecting a reference position, when the movable member is in the predetermined range, including a plurality of reference position signal generating position candidates for a reference position signal generating position where the reference position signal is generated, comprising: a selecting section configured to select one generating position candidate as the reference position signal generating position from the generating position candidates; and a judging section configured to detect an optimal generating position candidate from the reference position signal generating position candidates when the signal for detecting the reference position is generated, and the selecting section being capable of selecting the reference position signal generating position based on a judgment result of the judging section, the method for detecting the optimal reference position candidate of the displacement sensor, comprising: detecting the generation of the signal for detecting the reference position; detecting the optimal reference position candidate by the judging section; outputting the judgment result; and switching the setting of the reference position.
 60. The method for detecting the optimal reference position candidate of the displacement sensor according to claim 59, further comprising: ending a detection sequence of the optimal reference position candidate, when the moving direction of the movable member is reversed.
 61. A method for detecting an optimal reference position candidate of a displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range. the displacement sensor generating a signal for detecting a reference position, when the movable member is in the predetermined range, including a plurality of reference position signal generating position candidates for a reference position signal generating position where the reference position signal is generated, comprising: a selecting section configured to select one generating position candidate as the reference position signal generating position from the generating position candidates; and a judging section configured to detect an optimal generating position candidate from the reference position signal generating position candidates when the signal for detecting the reference position is generated, and the selecting section being capable of selecting the reference position signal generating position based on a judgment result of the judging section, the method for detecting the optimal reference position candidate of the displacement sensor, comprising: detecting the generation of the signal for detecting the reference position; detecting the optimal reference position candidate by the judging section; outputting the judgment result; judging whether setting reflects the judgment result; and switching the setting of the reference position only when judging that the setting should be reflected.
 62. The method for detecting the optimal reference position candidate of the displacement sensor according to claim 61, further comprising: ending a detection sequence of the optimal reference position candidate, when the moving direction of the movable member is reversed.
 63. A displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the sensor comprising: a generating section of a signal for detecting a reference position configured to generate a signal for detecting the reference position, which is not necessarily synchronized with the periodical signal, when the movable member is in the predetermined range; and a stability judging section configured to judge stability of the existing reference position signal generating position based on phase margin between the phase of the periodical signal when the signal for detecting the reference position is generated and that in the reference position signal generating position.
 64. The displacement sensor according to claim 63, wherein the stability judging section judges that the existing reference position signal generating position is most stable at a phase difference of 180° and is most unstable at a phase difference of 0°, when the difference between the phase of the periodical signal when the signal for detecting the reference position is generated and that in the reference position signal generating position is represented from 0° to 180°.
 65. The displacement sensor according to claim 63, wherein there are a plurality of candidates for the reference position signal generating position, and one of the candidates is able to be selected as the reference position signal generating position.
 66. The displacement sensor according to claim 65, wherein designation of the reference position signal generating position is able to be changed based on a result of the stability judgment.
 67. The displacement sensor according to claim 65, wherein the stability judging section is able to automatically acquire the information on which candidate of the reference position signal generating position is the designated reference position signal generating position.
 68. The displacement sensor according to claim 63, wherein the periodical signals are two periodical signals which substantially have a 90° phase difference, a coordinate system is disposed so that an output of one of the two periodical signals is taken in the horizontal axis direction of a two-dimensional orthogonal coordinate system, the output of the other is taken in the vertical axis direction, and values of coordinates in intersections of the vertical and horizontal axes agree with amplitude center values of the outputs of the two periodical signals, a waveform drawn by a point determined by the outputs of the two periodical signals with the displacement of the movable member on the coordinate system is a Lissajous waveform of the two periodical signals, and the stability judging section divides the Lissajous waveform of the two periodical signals into two or more segments, and judges the stability based on the segment on the Lissajous waveform in which a point determined by the two periodical signals exists when the signal for detecting the reference position is generated.
 69. The displacement sensor according to claim 68, wherein the segments are obtained by dividing the Lissajous waveform of the two periodical signals so that corresponding displacement amount is substantially equal.
 70. The displacement sensor according to claim 68, wherein assuming that the difference is represented from 0° to 180° between the phase of the periodical signal in the segment on the Lissajous waveform in which the point determined by the two periodical signals exists when the signal for detecting the reference position is generated and the phase of the periodical signal in the reference position signal generating position, the stability judging section regards a minimum value of the phase difference within a segment as the phase difference between the segment and the reference position signal generating position, and judges that the existing reference position signal generating position is most stable at a phase difference of 180° and is most unstable at a phase difference of 0°.
 71. The displacement sensor according to claim 68, wherein the number of segments is two.
 72. The displacement sensor according to claim 71, wherein two segments obtained by dividing the Lissajous waveform of the two periodical signals by one of the vertical and horizontal axes are the segments.
 73. The displacement sensor according to claim 72, wherein when there are two reference position signal generating position candidates, two intersections of the Lissajous waveform of the two periodical signals with the vertical axis are phases of each reference position signal generating position candidate, and two segments are obtained by dividing the Lissajous waveform of the two periodical signals by the horizontal axis, the stability judging section judges that the existing reference position signal generating position is unstable if the segment on the Lissajous waveform in which the point determined by the two periodical signals exists when the signal for detecting the reference position is generated and the reference position signal generating position are included in the same segment, and judges that the existing reference position signal generating position is stable if the segment on the Lissajous waveform and the reference position signal generating position are included in different segments.
 74. The displacement sensor according to claim 73, wherein the stability judging section judges that the existing reference position signal generating position is unstable, when the binarized signal of the periodical signal corresponding to the vertical axis in the two periodical signals indicates the same signal level when the signal for detecting the reference position is generated and in the reference position signal generating position, and judges that the existing reference position signal generating position is stable, when the binarized signal indicates different levels.
 75. The displacement sensor according to claim 68, wherein the number of segments is four.
 76. The displacement sensor according to claim 75, wherein the four segments are obtained by dividing the Lissajous waveform of the two periodical signals by the vertical and horizontal axes.
 77. The displacement sensor according to claim 75, wherein the four segments are obtained by dividing the Lissajous waveform by two straight lines which pass through the intersections of the vertical and horizontal axes and which have an inclination of ±45° with respect to the horizontal axis.
 78. The displacement sensor according to claim 68, wherein the number of segments is eight.
 79. The displacement sensor according to claim 78, wherein the eight segments are obtained by dividing the Lissajous waveform of the two periodical signals by four straight lines including the vertical and horizontal axes and two straight lines which pass through the intersections of the vertical and horizontal axes and which have an inclination of ±45° with respect to the horizontal axis.
 80. The displacement sensor according to claim 63, wherein the stability judging section carries out both the judgment of the stability and the output of the stability, only when the movable member moves in a direction for detecting the reference position.
 81. The displacement sensor according to claim 63, wherein the level of the stability is represented in a digital manner.
 82. A method for judging stability of reference position detection of a displacement sensor which detects displacement amount based on periodical signals generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a reference position signal generating position as one of the predetermined position and angle, the displacement sensor generating a signal for detecting a reference position, when the movable member is in a predetermined range, and comprising a stability judging section configured to judge stability of the existing reference position signal generating position based on phase margin between the phase of the periodical signal when the signal for detecting the reference position is generated and that in the reference position signal generating position, the method for judging the stability of the reference position detection of the displacement sensor, comprising: detecting the generation of the signal for detecting the reference position; judging the stability of the existing reference position by the stability judging section; and outputting the judgment result.
 83. The method for judging the stability of the reference position detection of the displacement sensor according to claim 82, wherein when there are a plurality of reference position signal generating position candidates in the reference position signal generating position for generating the reference position signal, and the displacement sensor further comprising: a selecting section configured to select one generating position candidate as the reference position signal generating position from the generating position candidates, the method further comprising: judging whether or not to reflect a judgment result; and switching the setting of the reference position, only when it is judged that the judgment result should be reflected.
 84. The method for judging the stability of the reference position detection of the displacement sensor according to claim 83, wherein judging whether or not to reflect the judgment result and switching the setting of the reference position are automatically performed.
 85. The method for judging the stability of the reference position detection of the displacement sensor according to claim 82, further comprising: ending a sequence of the stability judgment, when the moving direction of the movable member is reversed.
 86. A displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the displacement sensor comprising: a plurality of reference position signal generating position candidates where the reference position signals are generated; judging means for detecting an optimal candidate from the reference position signal generating position candidates; and selecting means for selecting one candidate from the reference position signal generating position candidates and switching the reference position signal generating position to the candidate, wherein the selecting means is able to select the reference position signal generating position based on a judgment result from the judging means.
 87. A displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the displacement sensor comprising: a plurality of reference position signal generating position candidates where the reference position signals are generated; and selecting means for selecting one candidate from the reference position signal generating position candidates and switching the reference position signal generating position to the candidate, wherein the reference position signal generating position candidates correspond to a plurality of phases of the periodical signal, and the selecting means is able to select and switch to one of the phase candidates as the phase of the reference position signal generating position.
 88. A displacement sensor which detects displacement amount based on a periodical signal generated in response to displacement of one of the position and angle of a movable member and which generates a reference position signal, when the movable member is in a predetermined range, the displacement sensor comprising: generating means of a signal for detecting a reference position, for generating the signal for detecting the reference position, which is not necessarily synchronized with the periodical signal, when the movable member is in the predetermined range; and stability judging means for judging stability of the existing reference position signal generating position based on phase margin between the phase of the periodical signal when the signal for detecting the reference position is generated and that in the reference position signal generating position. 